Repository navigation
fix(balance): clear cached P2C ready index after a discovery removal - #1
Open
clemenslosbichler-cloud wants to merge 3 commits into
Open
clemenslosbichler-cloud wants to merge 3 commits into
clemenslosbichler-cloud wants to merge 3 commits into
Conversation
`Balance::poll_ready` caches the P2C-selected endpoint as a numeric `ready_index`. When a later `poll_ready` processes a `Change::Remove`, it calls `ReadyCache::evict`, which removes from the ready set with `swap_remove` and can move a different endpoint into the slot the cached index points at. The stale index was then revalidated by `check_ready_index` and dispatched to by `call`, silently bypassing the P2C choice during endpoint churn. Clear `ready_index` whenever a removal evicts a service, so the next `poll_ready` re-runs P2C over the current ready set. Also correct the `poll_ready` comment that wrongly claimed discovery updates cannot disturb the order of existing ready services.
…s#856) Drive a balancer to cache a P2C selection, remove that endpoint so eviction swap-moves a different endpoint into the cached slot, and assert the next request is routed by a fresh P2C selection rather than to the swapped-in endpoint. Uses a fed-on-demand Discover (deterministic ready-set order) and a zero RNG (deterministic P2C sampling).
Break the `changes.borrow_mut().push_back(..)` chains onto multiple lines to satisfy rustfmt's chain_width, fixing the `style` CI job.
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.
Recreation of tower-rs#874 on a fork, for testing an automated code reviewer against real code. Not a contribution and not intended to be merged. Upstream: tower-rs#874