Repository navigation
Reset metadata backoff after a broker connection recovers - #3197
narayana006 wants to merge 2 commits into
Conversation
|
My concern here is that it leaks the |
|
Thanks for the feedback. Updated this PR in a65989e to keep the metadata backoff key inside The connection manager now calls Local validation: 565 networking, cluster metadata and consumer-fetch tests pass, including recovery round trips on both selector and asyncio backends; repository-wide Would this connection-ready notification be a suitable interface, or would you prefer a different handoff between the manager and metadata? |
When metadata refresh finds no available broker, it enters exponential backoff. A later successful broker connection used to leave that metadata backoff intact, delaying even a requested refresh.
The connection manager now notifies
ClusterMetadata.on_connection_ready()after successful initialization.ClusterMetadataresets its own retry state, keeping themetadatabackoff key insidekafka/cluster.py. The existing bootstrap opt-out remains intact, failed connections retain their backoff, and unrelated brokers retain their retry delays.Regression tests check metadata TTL, bootstrap and failure controls. Protocol round trips against MockCluster verify that both selector and asyncio backends obtain changed partition metadata after reconnection without waiting for the previous exponential backoff.
Refs #3188.
Validation on macOS / Python 3.11.15:
make lintandgit diff --checkpass.The live Docker/broker-restart and FENCED_LEADER_EPOCH scenario, full test suite and broker/Python CI matrix were not run locally; these tests isolate the metadata-backoff recovery path.