Skip to content

Commit a970870

Browse files
committed
Avoid unknown coordinator after client poll
1 parent 218a901 commit a970870

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

kafka/coordinator/base.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,12 @@ def ensure_active_group(self):
245245
# ensure that there are no pending requests to the coordinator.
246246
# This is important in particular to avoid resending a pending
247247
# JoinGroup request.
248-
if self._client.in_flight_request_count(self.coordinator_id):
249-
while not self.coordinator_unknown():
250-
self._client.poll(delayed_tasks=False)
251-
if not self._client.in_flight_request_count(self.coordinator_id):
252-
break
253-
else:
254-
continue
248+
while not self.coordinator_unknown():
249+
if not self._client.in_flight_request_count(self.coordinator_id):
250+
break
251+
self._client.poll(delayed_tasks=False)
252+
else:
253+
continue
255254

256255
future = self._send_join_group_request()
257256
self._client.poll(future=future)

0 commit comments

Comments
 (0)