We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68068ca commit 41aa034Copy full SHA for 41aa034
kafka/client_async.py
@@ -665,8 +665,14 @@ def in_flight_request_count(self, node_id=None):
665
666
def _fire_pending_completed_requests(self):
667
responses = []
668
- while self._pending_completion:
669
- response, future = self._pending_completion.popleft()
+ while True:
+ try:
670
+ # We rely on deque.popleft remaining threadsafe
671
+ # to allow both the heartbeat thread and the main thread
672
+ # to process responses
673
+ response, future = self._pending_completion.popleft()
674
+ except IndexError:
675
+ break
676
future.success(response)
677
responses.append(response)
678
return responses
0 commit comments