Skip to content

fix(noq): resolve pending OpenPath on connection termination - #795

Open
mp0rta wants to merge 1 commit into
n0-computer:mainfrom
mp0rta:fix/open-path-connection-termination
Open

fix(noq): resolve pending OpenPath on connection termination#795
mp0rta wants to merge 1 commit into
n0-computer:mainfrom
mp0rta:fix/open-path-connection-termination

Conversation

@mp0rta

@mp0rta mp0rta commented Aug 31, 2026

Copy link
Copy Markdown

This was discovered while testing an experimental Zenoh-over-MPQUIC demo:
when the underlying QUIC connection was closed while an additional path was still being validated, the task awaiting open_path() never completed, stalling transport shutdown and recovery.

Description

A pending OpenPath future did not resolve when its connection terminated.

State::terminate notified the other waiter classes but left the
open_path watch senders registered. As a result, the future could remain
pending indefinitely and retain the connection state through its
ConnectionRef.

This change:

  • drains pending open_path senders during connection termination;
  • resolves them with PathError::ValidationFailed, matching the existing
    handling of PathEvent::Abandoned for paths that have not opened yet;
  • adds a regression test that closes a connection while path validation
    against a blackholed address is pending.

Related to #684.

Breaking Changes

None.

Notes & open questions

The regression test passes on the updated implementation and would time out
without the termination handling.

Change checklist

  • Self-review.
  • Tests if relevant.
  • All breaking changes documented.
  • This PR was created by a human that thought critically about the
    proposed change and wrote as clear and concise a description as possible.
  • This PR isn't slop and is carefully crafted to have the intended effect.
  • cargo make passes locally.

A pending OpenPath was never resolved on connection close or death: terminate() notified every other waiter class but did not drain the open_path watch senders, so the future hung forever and its ConnectionRef kept the connection state alive.

Drain pending senders with ValidationFailed, matching the semantics used when PathEvent::Abandoned is received for a path that has not opened yet. Add a regression test that closes the connection while path validation is pending.
@n0bot n0bot Bot added this to iroh Aug 31, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh Aug 31, 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