Skip to content

Commit b8912f7

Browse files
authored
Release coordinator lock before calling maybe_leave_group (#2460)
1 parent cfd57f2 commit b8912f7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

kafka/coordinator/base.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,11 @@ def _run_once(self):
990990
# foreground thread has stalled in between calls to
991991
# poll(), so we explicitly leave the group.
992992
log.warning('Heartbeat poll expired, leaving group')
993+
### XXX
994+
# maybe_leave_group acquires client + coordinator lock;
995+
# if we hold coordinator lock before calling, we risk deadlock
996+
# release() is safe here because this is the last code in the current context
997+
self.coordinator._lock.release()
993998
self.coordinator.maybe_leave_group()
994999

9951000
elif not self.coordinator.heartbeat.should_heartbeat():

0 commit comments

Comments
 (0)