diff options
author | Dana Powers <dana.powers@gmail.com> | 2016-12-02 18:25:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-02 18:25:28 -0800 |
commit | 010ebb53a9e3b1c4e8d69a623e4a082b5a2b9baa (patch) | |
tree | 8d1d172b983c7cb4bdc70418d4e971d99b2b30d6 /kafka/coordinator/base.py | |
parent | 9b59c5d755af73c2e7863e98b84b5882c297afda (diff) | |
download | kafka-python-010ebb53a9e3b1c4e8d69a623e4a082b5a2b9baa.tar.gz |
Fix possible request draining in ensure_active_group (#896)
Diffstat (limited to 'kafka/coordinator/base.py')
-rw-r--r-- | kafka/coordinator/base.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kafka/coordinator/base.py b/kafka/coordinator/base.py index 22dffb4..e4ebcb0 100644 --- a/kafka/coordinator/base.py +++ b/kafka/coordinator/base.py @@ -246,9 +246,12 @@ class BaseCoordinator(object): # This is important in particular to avoid resending a pending # JoinGroup request. if self._client.in_flight_request_count(self.coordinator_id): - while self._client.in_flight_request_count(self.coordinator_id): - self._client.poll() - continue + while not self.coordinator_unknown(): + self._client.poll(delayed_tasks=False) + if not self._client.in_flight_request_count(self.coordinator_id): + break + else: + continue future = self._send_join_group_request() self._client.poll(future=future) |