summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIonel Cristian Mărieș <contact@ionelmc.ro>2014-03-19 15:30:17 +0200
committerIonel Cristian Mărieș <contact@ionelmc.ro>2014-03-19 15:30:17 +0200
commit3cc46bfe4d18f1f70bb3d6f33c1860ff2b56a052 (patch)
treec75437a5d5738df4405b5258828a9d9f5fd8b09c
parent0136555208a8b14d516a3e7183dd172dcfb11c71 (diff)
downloadkombu-fix-async-sem-release.tar.gz
Don't increase the semaphore is a callback is going to get called (this will make the callbacks waiting for the semaphore run for free, even there's no space to run them).fix-async-sem-release
-rw-r--r--kombu/async/semaphore.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/kombu/async/semaphore.py b/kombu/async/semaphore.py
index 58b4ff72..b4464410 100644
--- a/kombu/async/semaphore.py
+++ b/kombu/async/semaphore.py
@@ -71,11 +71,10 @@ class LaxBoundedSemaphore(object):
that is waiting for the resource (FIFO order).
"""
- self.value = min(self.value + 1, self.initial_value)
try:
waiter, args = self._pop_waiter()
except IndexError:
- pass
+ self.value = min(self.value + 1, self.initial_value)
else:
waiter(*args)