fix(socket): skip same conn in cross-conn path dedup#4245
Draft
rklaehn wants to merge 1 commit into
Draft
Conversation
The dedup loop in RemoteStateActor::handle_path_event for `Abandoned`
events iterates self.connections to close paths sharing the abandoned
path's remote address. Its purpose is cross-ALPN cleanup: if address X
became unreachable for one conn, close paths to X in our other conns
too. The loop wasn't excluding the conn the event came from, so when
two path_ids within a single conn happened to share a `transports::Addr`
(can occur with NAT-traversal candidate mapping), abandoning one closed
the other.
Effect on multi-direct-path scenarios: server receives PATH_ABANDON for
path 0, runs the dedup loop within its own conn, closes a still-live
path 1 sharing path 0's address. With no remaining paths the server
hits the multipath grace timer and the connection ends with
`NO_VIABLE_PATH("last path abandoned, no new path opened")`.
Skip the source conn in the iteration; rename the loop variable to
`other_conn_id` to make the constraint explicit. Cross-conn dedup
behavior is unchanged.
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/4245/docs/iroh/ Last updated: 2026-05-08T17:57:01Z |
4 tasks
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.
Apparently this fixes the issue?
The dedup loop in RemoteStateActor::handle_path_event for
Abandonedevents iterates self.connections to close paths sharing the abandoned path's remote address. Its purpose is cross-ALPN cleanup: if address X became unreachable for one conn, close paths to X in our other conns too. The loop wasn't excluding the conn the event came from, so when two path_ids within a single conn happened to share atransports::Addr(can occur with NAT-traversal candidate mapping), abandoning one closed the other.Effect on multi-direct-path scenarios: server receives PATH_ABANDON for path 0, runs the dedup loop within its own conn, closes a still-live path 1 sharing path 0's address. With no remaining paths the server hits the multipath grace timer and the connection ends with
NO_VIABLE_PATH("last path abandoned, no new path opened").Skip the source conn in the iteration; rename the loop variable to
other_conn_idto make the constraint explicit. Cross-conn dedup behavior is unchanged.Description
Breaking Changes
Notes & open questions
Change checklist
quic-rpciroh-gossipiroh-blobsdumbpipesendme