summaryrefslogtreecommitdiff
path: root/kazoo/recipe
diff options
context:
space:
mode:
authorBen Bangert <ben@groovie.org>2017-05-31 13:37:05 -0700
committerGitHub <noreply@github.com>2017-05-31 13:37:05 -0700
commit2a3e9d19cd0fde7b03ac8c750e2b107353e3e814 (patch)
tree46d5a9dd42e768e98747fafdf1a7395bd359f941 /kazoo/recipe
parent6cab0f04c7e397c9070cb9a33e918c86860c2bf1 (diff)
parent57f64c09f65b6841fb79a59d411cef0211721087 (diff)
downloadkazoo-2a3e9d19cd0fde7b03ac8c750e2b107353e3e814.tar.gz
Merge pull request #359 from rockerbox/queue-patch
Fixed Queue to clear children before retry
Diffstat (limited to 'kazoo/recipe')
-rw-r--r--kazoo/recipe/queue.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/kazoo/recipe/queue.py b/kazoo/recipe/queue.py
index 9bfd70f..645e447 100644
--- a/kazoo/recipe/queue.py
+++ b/kazoo/recipe/queue.py
@@ -94,17 +94,13 @@ class Queue(BaseQueue):
name = self._children[0]
try:
data, stat = self.client.get(self.path + "/" + name)
+ self.client.delete(self.path + "/" + name)
except NoNodeError: # pragma: nocover
# the first node has vanished in the meantime, try to
# get another one
+ self._children = []
raise ForceRetryError()
- try:
- self.client.delete(self.path + "/" + name)
- except NoNodeError: # pragma: nocover
- # we were able to get the data but someone else has removed
- # the node in the meantime. consider the item as processed
- # by the other process
- raise ForceRetryError()
+
self._children.pop(0)
return data