feat(iroh): Retain stats for closed and abandoned paths in the path watcher#3899
Open
feat(iroh): Retain stats for closed and abandoned paths in the path watcher#3899
Conversation
6bf73fc to
ed10e46
Compare
ed10e46 to
b324c7a
Compare
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3899/docs/iroh/ Last updated: 2026-02-05T08:44:28Z |
cec6756 to
6285cb7
Compare
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.
Description
Depends on n0-computer/quinn#386
Improves the path watcher for connections to reliably allow accessing the stats of abandoned paths.
PathWatcheralive for the duration of a connection, it will contain all paths the connection ever used.Pathis alive, addWeakPathHandlequinn#386 and keep aWeakPathHandlefor all paths in the watchable's value. This prevents the path stats to be dropped within a quinn connection even if the path is abandoned.WeakPathHandle, we can ensure that the stats are always available as long as the connection hasn't been dropped.The combination of all this gives us a reliable way to access final path stats for all paths used in a connection, as long as you keep a reference to the connection around, which is quite straightforward to do and document.
Breaking Changes
Connection::pathsandConnectionInfo::pathsnow return aPathWatcher(which still implementsn0_watcher::Watcherbut now also is a named struct)PathInfo::statsandPathInfo::rttnow returnOption. They returnNoneif the underlying connection has been droped.Notes & open questions
I spend quite some time going back-and-forth over different approaches. Very open to other ideas, but I'm a bit out of further ideas currently and this is the best I could come up with so far.
Change checklist
quic-rpciroh-gossipiroh-blobsdumbpipesendme