diff options
author | Ionel Cristian Mărieș <contact@ionelmc.ro> | 2014-03-19 15:30:17 +0200 |
---|---|---|
committer | Ionel Cristian Mărieș <contact@ionelmc.ro> | 2014-03-19 15:30:17 +0200 |
commit | 3cc46bfe4d18f1f70bb3d6f33c1860ff2b56a052 (patch) | |
tree | c75437a5d5738df4405b5258828a9d9f5fd8b09c | |
parent | 0136555208a8b14d516a3e7183dd172dcfb11c71 (diff) | |
download | kombu-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.py | 3 |
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) |