Skip to content

fix(socket): skip same conn in cross-conn path dedup#4245

Draft
rklaehn wants to merge 1 commit into
mainfrom
fix-double-close
Draft

fix(socket): skip same conn in cross-conn path dedup#4245
rklaehn wants to merge 1 commit into
mainfrom
fix-double-close

Conversation

@rklaehn
Copy link
Copy Markdown
Contributor

@rklaehn rklaehn commented May 8, 2026

Apparently this fixes the issue?

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.

Description

Breaking Changes

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.
    • List all breaking changes in the above "Breaking Changes" section.
    • Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are:

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.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Netsim report & logs for this PR have been generated and is available at: LOGS
This report will remain available for 3 days.

Last updated for commit: 0d7d307

@n0bot n0bot Bot added this to iroh May 8, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🚑 Needs Triage

Development

Successfully merging this pull request may close these issues.

1 participant