cluster: fence host state and pool races by endpoint#836
Draft
dkropachev wants to merge 4 commits intomasterfrom
Draft
cluster: fence host state and pool races by endpoint#836dkropachev wants to merge 4 commits intomasterfrom
dkropachev wants to merge 4 commits intomasterfrom
Conversation
2094ebd to
db683a0
Compare
db683a0 to
cff85ac
Compare
cff85ac to
368e7e6
Compare
f72c05d to
72c4f4c
Compare
Track the endpoint tied to host up/down handling, reconnection callbacks, and pool cleanup so stale work from a previous endpoint cannot mark or reconnect a replacement host. Preserve endpoint-specific identity for SNI and client-routes endpoints, scope non-retryable auth failures to the matching endpoint, and remove stale pools by host identity instead of endpoint equality. Add unit coverage for endpoint swaps, queued up/down races, stale reconnector success, and defunct connection handling after client-route port changes.
f5a6b91 to
f77de24
Compare
Comment on lines
+2290
to
+2291
| def _on_up(self, host, expected_epoch=None, expected_endpoint=None, | ||
| expected_reconnector=None): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hostequality.UPevents after activeDOWNhandling finishes, while preserving newer down events, removals, and endpoint swaps that should cancel stale replay.Driver surface and risks
HostConnectionreconnect/shard-aware paths.Fixes #317
Test coverage
tests/unit/test_cluster.pyfor pool-creation races, stale up/down callbacks, queued-up replay, endpoint swaps, reconnector fencing, and non-retryable auth failure handling.tests/unit/test_control_connection.pyfor preserving endpoint identity in delayed status events.tests/unit/test_host_connection_pool.pyfor ignoring defunct stale connections after endpoint/client-route changes.Validation
uv run pytest tests/unit/test_cluster.py -qgit diff --checkPre-review checklist
./docs/source/.Fixes:annotations to PR description.