Skip to content

fix: reconnect when leader connection recently lost - #115

Merged
zmstone merged 1 commit into
kafka4beam:mainfrom
zmstone:260316-reconnect-on-recent-disconnect
Mar 20, 2026
Merged

fix: reconnect when leader connection recently lost#115
zmstone merged 1 commit into
kafka4beam:mainfrom
zmstone:260316-reconnect-on-recent-disconnect

Conversation

@zmstone

@zmstone zmstone commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

When a leader connection is killed (e.g. by Kafka's idle connection timeout) right after a metadata refresh, subsequent get_leader_connections calls would skip reconnection because the metadata timestamp was still fresh. This could result in stale dead connections being returned to health checks until the next metadata refresh cycle.

Disconnected connections now carry a timestamp so that ensure_leader_connections can detect recent disconnects per topic and bypass the metadata freshness cache when needed.

When a leader connection is killed (e.g. by Kafka's idle connection
timeout) right after a metadata refresh, subsequent get_leader_connections
calls would skip reconnection because the metadata timestamp was still
fresh. This could result in stale dead connections being returned to
health checks until the next metadata refresh cycle.

Disconnected connections now carry a timestamp so that
ensure_leader_connections can detect recent disconnects per topic
and bypass the metadata freshness cache when needed.
@zmstone
zmstone merged commit 36a91cb into kafka4beam:main Mar 20, 2026
4 checks passed
@zmstone
zmstone deleted the 260316-reconnect-on-recent-disconnect branch March 20, 2026 12:33
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.

1 participant