-
Notifications
You must be signed in to change notification settings - Fork 351
feat(iroh): Retain stats for closed and abandoned paths in the path watcher #3899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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-09T14:52:23Z |
cec6756 to
6285cb7
Compare
… may be intermediate updates
iroh/src/socket/transports.rs
Outdated
| } | ||
| } | ||
|
|
||
| pub(crate) fn is_transport_addr(&self, transport_addr: &TransportAddr) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this be an impl of PartialEq instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, why not. Changed it.
Description
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