Skip to content

Bugfix: sync group request timeout error will lead to consumer come in an abnormal status #1693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion kafka/coordinator/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,12 @@ def _send_join_group_request(self):
def _failed_request(self, node_id, request, future, error):
log.error('Error sending %s to node %s [%s]',
request.__class__.__name__, node_id, error)

# If sync group request timeout, we need try to rejoin group
version = 0 if self.config['api_version'] < (0, 11, 0) else 1
if isinstance(request, SyncGroupRequest[version]):
self.request_rejoin()

# Marking coordinator dead
# unless the error is caused by internal client pipelining
if not isinstance(error, (Errors.NodeNotReadyError,
Expand Down Expand Up @@ -716,7 +722,8 @@ def reset_generation(self):
self.state = MemberState.UNJOINED

def request_rejoin(self):
self.rejoin_needed = True
with self._lock:
self.rejoin_needed = True

def _start_heartbeat_thread(self):
if self._heartbeat_thread is None:
Expand Down