diff options
author | Dana Powers <dana.powers@gmail.com> | 2019-05-28 22:39:48 -0700 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2019-09-29 11:05:32 -0700 |
commit | 318c261118299d57a2eabe9633fb7caf45c83a08 (patch) | |
tree | 278b91078b2d0a5b63d1117d7733e0e478ed54b0 /kafka/client_async.py | |
parent | 89bf6a6ee51e8a54f909eae4785d04e485b91198 (diff) | |
download | kafka-python-coordinator_lock_order.tar.gz |
Change coordinator lock acquisition ordercoordinator_lock_order
* Coordinator lock acquired first, client lock acquired second
* Release client lock to process futures
Diffstat (limited to 'kafka/client_async.py')
-rw-r--r-- | kafka/client_async.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kafka/client_async.py b/kafka/client_async.py index ac2d364..87922b2 100644 --- a/kafka/client_async.py +++ b/kafka/client_async.py @@ -595,7 +595,9 @@ class KafkaClient(object): self._poll(timeout / 1000) - responses.extend(self._fire_pending_completed_requests()) + # called without the lock to avoid deadlock potential + # if handlers need to acquire locks + responses.extend(self._fire_pending_completed_requests()) # If all we had was a timeout (future is None) - only do one poll # If we do have a future, we keep looping until it is done |