Skip to content

Conversation

@dpkp
Copy link
Owner

@dpkp dpkp commented Nov 20, 2025

Attempt to fix issue raised in #2672 and possibly also #2667

If the coordinator node becomes unresponsive it can cause the consumer to busy-loop until the next attempt to reconnect to the coordinator. This happens when there is no pending request to the coordinator node itself (either a heartbeat or commit) when the broker connection fails. If the consumer is configured with auto-commits then the next commit attempt will see the coordinator failure, mark the coordinator dead, and the consumer loop will revert to waiting for the coordinator to return. But if auto-commits are disabled, the heartbeat thread will be in a limbo state where it thinks the coordinator is connecting and pauses heartbeat request. With neither a failed connection attempt or a failed heartbeat request, the coordinator is never marked dead and the consumer busy loops. To fix, this patch adds an explicit connection attempt to the heartbeat thread loop whenever the coordinator is known but disconnected. If the connection fails the client will mark the node as disconnected and add a backoff reconnect delay. The non-zero backoff delay causes the consumer to mark the coordinator dead, which prevents the busy loop.

@dpkp dpkp merged commit 8d38aa7 into master Nov 20, 2025
18 checks passed
@dpkp dpkp deleted the dpkp/coordinator-reconnect branch November 20, 2025 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants