Filter removed server addresses with OptionalTransport equality#4561
Open
pepone wants to merge 2 commits intoicerpc:mainfrom
Open
Filter removed server addresses with OptionalTransport equality#4561pepone wants to merge 2 commits intoicerpc:mainfrom
pepone wants to merge 2 commits intoicerpc:mainfrom
Conversation
The locator filter at LocatorInterceptor.ComputeServerAddresses used default ServerAddress equality on RemovedServerAddresses, which requires an exact transport-string match. The connection layer (ClientConnection / ConnectionCache) treats two server addresses as the same physical endpoint when their Protocol/Host/Port/Params match and at least one Transport is null (ServerAddressComparer.OptionalTransport). This asymmetry let a replica that the retry interceptor previously removed (e.g. ice://host:10000?transport=tcp) survive the filter when the locator re-returned it without a transport (ice://host:10000). The retry loop then re-targeted the same broken endpoint. Build a HashSet keyed on OptionalTransport once and use it for both the main and alt-server filters. Add a regression test covering the explicit-transport / no-transport asymmetry.
There was a problem hiding this comment.
Pull request overview
This PR fixes a retry/locator filtering mismatch by ensuring removed server addresses are compared using the same equality semantics as the connection layer, preventing a just-failed replica from being reintroduced when re-resolved without an explicit transport.
Changes:
- Update
LocatorInterceptor.ComputeServerAddressesto filter removed addresses usingServerAddressComparer.OptionalTransport. - Apply the same comparer to both main and alt-server address filtering.
- Add a regression test for the explicit-transport vs null-transport removed-address asymmetry.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/IceRpc.Locator.Tests/LocatorInterceptorTests.cs | Adds a regression test ensuring transport-normalized re-resolution doesn’t bypass removed-address filtering. |
| src/IceRpc.Locator/LocatorInterceptor.cs | Uses ServerAddressComparer.OptionalTransport for removed-address filtering to align with connection-layer address identity. |
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.
Fixes #4429