fix(noq): resolve pending OpenPath on connection termination - #795
Open
mp0rta wants to merge 1 commit into
Open
Conversation
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.
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.
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
OpenPathfuture did not resolve when its connection terminated.State::terminatenotified the other waiter classes but left theopen_pathwatch senders registered. As a result, the future could remainpending indefinitely and retain the connection state through its
ConnectionRef.This change:
open_pathsenders during connection termination;PathError::ValidationFailed, matching the existinghandling of
PathEvent::Abandonedfor paths that have not opened yet;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
proposed change and wrote as clear and concise a description as possible.
cargo makepasses locally.