Skip to content

refactor!: improve path events around path closing#427

Merged
Frando merged 6 commits intomainfrom
Frando/close-path
Feb 20, 2026
Merged

refactor!: improve path events around path closing#427
Frando merged 6 commits intomainfrom
Frando/close-path

Conversation

@Frando
Copy link
Copy Markdown
Member

@Frando Frando commented Feb 16, 2026

Description

Fixes #421

This changes the events that are emitted from quinn_proto, and quinn, for when paths become closed.

What on current main is PathEvent::Abandoned has been renamed to PathEvent::Discarded, because this event was and is emitted not when the path is abandoned (i.e. becomes no longer usable) but when the path was discarded (i.e. all state for the path is cleared, and the path stats become final and will no longer change).

A new PathEvent::Abandoned is added which replaces both the now-removed PathEvent::LocallyClosed and the PathEvent::Closed which was removed in #419.

The new PathEvent::Abandoned contains a PathAbandonReason enum, which contains cases for the various reasons why a path may be closed from the local side, plus a RemoteAbandoned variant if the remote closed the path.

Internally, some logic that was previously spread out is now unified into this enum as well.

Breaking Changes

  • Removed quinn_proto::PathEvent::LocallyClosed
  • Renamed quinn_proto::PathEvent::Abandoned to quinn_proto::PathEvent::Discarded
  • Added quinn_proto::PathEvent::Abandoned

Notes & open questions

We could add distinct events for when a not-yet-opened path is abandoned, and for when a already-opened path has been abandoned. I'm not sure if it's worth it though, the difference would be minor.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 16, 2026

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/quinn/pr/427/docs/iroh_quinn/

Last updated: 2026-02-20T16:11:31Z

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 16, 2026

Performance Comparison Report

0f408349aaaac9672c6030795554b351eb21467d - artifacts

No results available

---
4993dd2b827b63567278a7f50978acce0899ae44 - artifacts

No results available

---
34fd5a742071c77c9d4c161e26826254a202c39a - artifacts

Raw Benchmarks (localhost)

Scenario iroh-quinn upstream Delta CPU (avg/max)
large-single 5310.8 Mbps 7954.5 Mbps -33.2% 92.9% / 97.9%
medium-concurrent 5406.4 Mbps 7762.8 Mbps -30.4% 98.8% / 157.0%
medium-single 3875.2 Mbps 4654.8 Mbps -16.7% 95.3% / 106.0%
small-concurrent 3802.1 Mbps 5278.0 Mbps -28.0% 96.5% / 107.0%
small-single 3531.3 Mbps 4771.1 Mbps -26.0% 91.9% / 108.0%

Netsim Benchmarks (network simulation)

Condition iroh-quinn upstream Delta
ideal 2892.6 Mbps 3988.5 Mbps -27.5%
lan 777.3 Mbps 804.6 Mbps -3.4%
wan 83.8 Mbps 83.8 Mbps ~0%

Summary

iroh-quinn is 27.2% slower on average

---
06ecf1ebdd5e05cff8a9ab6f5a48685466208f6d - artifacts

Raw Benchmarks (localhost)

Scenario iroh-quinn upstream Delta CPU (avg/max)
large-single 5474.9 Mbps 7873.7 Mbps -30.5% 96.0% / 104.0%
medium-concurrent 5481.6 Mbps 7802.6 Mbps -29.7% 94.8% / 104.0%
medium-single 3585.2 Mbps 4790.8 Mbps -25.2% 89.4% / 97.2%
small-concurrent 3802.5 Mbps 4957.3 Mbps -23.3% 90.4% / 98.5%
small-single 3475.2 Mbps 4877.4 Mbps -28.7% 94.9% / 105.0%

Netsim Benchmarks (network simulation)

Condition iroh-quinn upstream Delta
ideal 2990.6 Mbps N/A N/A
lan 782.5 Mbps N/A N/A
lossy 69.9 Mbps N/A N/A
wan 83.8 Mbps N/A N/A

Summary

iroh-quinn is 28.0% slower on average

---
30a21403f5c2b1b32dc185d59fe32161b72518b9 - artifacts

Raw Benchmarks (localhost)

Scenario iroh-quinn upstream Delta CPU (avg/max)
large-single 5455.9 Mbps 8199.2 Mbps -33.5% 99.4% / 157.0%
medium-concurrent 5455.1 Mbps 7671.0 Mbps -28.9% 98.5% / 157.0%
medium-single 4259.9 Mbps 4704.2 Mbps -9.4% 94.0% / 107.0%
small-concurrent 3722.5 Mbps 5010.7 Mbps -25.7% 96.1% / 107.0%
small-single 3438.5 Mbps 4377.8 Mbps -21.5% 90.6% / 98.2%

Netsim Benchmarks (network simulation)

Condition iroh-quinn upstream Delta
ideal 2955.5 Mbps 3995.1 Mbps -26.0%
lan 782.5 Mbps 810.4 Mbps -3.4%
lossy 69.9 Mbps 55.9 Mbps +25.0%
wan 83.8 Mbps 83.8 Mbps ~0%

Summary

iroh-quinn is 24.9% slower on average

---
7f9a648c4237e10e4c8e1c21eb2c3ca406e4a7ad - artifacts

Raw Benchmarks (localhost)

Scenario iroh-quinn upstream Delta CPU (avg/max)
large-single 5415.5 Mbps 7966.4 Mbps -32.0% 93.8% / 103.0%
medium-concurrent 5372.0 Mbps 7728.9 Mbps -30.5% 91.5% / 96.8%
medium-single 3918.3 Mbps 4748.8 Mbps -17.5% 84.9% / 94.6%
small-concurrent 3591.2 Mbps 5314.3 Mbps -32.4% 93.6% / 102.0%
small-single 3320.3 Mbps 4699.7 Mbps -29.3% 86.9% / 96.5%

Netsim Benchmarks (network simulation)

Condition iroh-quinn upstream Delta
ideal 3142.6 Mbps N/A N/A
lan 782.4 Mbps N/A N/A
lossy 69.8 Mbps N/A N/A
wan 83.8 Mbps N/A N/A

Summary

iroh-quinn is 29.0% slower on average

---
28465115d579e52c66cb525f91a7bb9310e35d57 - artifacts

Raw Benchmarks (localhost)

Scenario iroh-quinn upstream Delta CPU (avg/max)
large-single 5337.8 Mbps 7901.8 Mbps -32.4% 93.8% / 123.0%
medium-concurrent 5499.5 Mbps 7957.9 Mbps -30.9% 92.9% / 97.4%
medium-single 3827.7 Mbps 4749.0 Mbps -19.4% 94.0% / 126.0%
small-concurrent 3728.3 Mbps 4954.3 Mbps -24.7% 92.2% / 99.4%
small-single 3285.1 Mbps 4828.3 Mbps -32.0% 93.8% / 128.0%

Netsim Benchmarks (network simulation)

Condition iroh-quinn upstream Delta
ideal 3002.6 Mbps N/A N/A
lan 782.4 Mbps N/A N/A
lossy 69.9 Mbps N/A N/A
wan 83.8 Mbps N/A N/A

Summary

iroh-quinn is 28.7% slower on average

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 79.06977% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.43%. Comparing base (041777b) to head (2846511).

Files with missing lines Patch % Lines
quinn-proto/src/connection/mod.rs 84.00% 4 Missing ⚠️
quinn/src/connection.rs 50.00% 3 Missing ⚠️
quinn-proto/src/connection/paths.rs 90.00% 1 Missing ⚠️
quinn/src/path.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #427      +/-   ##
==========================================
+ Coverage   77.38%   77.43%   +0.05%     
==========================================
  Files          81       81              
  Lines       23360    23366       +6     
==========================================
+ Hits        18076    18093      +17     
+ Misses       5284     5273      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Frando Frando marked this pull request as ready for review February 16, 2026 13:30
@n0bot n0bot bot added this to iroh Feb 16, 2026
@github-project-automation github-project-automation bot moved this to 🚑 Needs Triage in iroh Feb 16, 2026
@Frando Frando changed the title refactor: improve path events around path closing refactor!: improve path events around path closing Feb 16, 2026
TimedOut,
/// The path became unusable after a local network change.
UnusableAfterNetworkChange,
/// The path was opened in a NAT traversal round which was superseded by a new round.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// The path was opened in a NAT traversal round which was superseded by a new round.
/// The path was opened in a NAT traversal round which was ended.

I'm not sure if it is correct to say that a round can not end before another one can start.

self.path_events.send(evt.clone()).ok();
Path(ref evt @ PathEvent::Abandoned { id, .. }) => {
if let Some(sender) = self.open_path.remove(&id) {
// TODO(frando):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a todo? Can it ever be resolved?

Copy link
Copy Markdown
Member Author

@Frando Frando Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I don't think this needs to be resolved further. The TODO is a leftover from before I wrote the lengthy comment. I think it's OK as-is. Removed the TODO.

@github-project-automation github-project-automation bot moved this from 🚑 Needs Triage to 🏗 In progress in iroh Feb 17, 2026
@flub flub added this to the quinn: iroh v0.98 milestone Feb 17, 2026
@Frando Frando requested a review from flub February 18, 2026 09:18
Copy link
Copy Markdown
Collaborator

@flub flub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, lost track of this for a few days. Apologies.

To me this is good. Though I think @divagant-martian still had some reservations about exposing abandoned and discarded as separate events. Personally I'm fine with both events though. If someone doesn't care about the discard they can just ignore it.

Copy link
Copy Markdown
Collaborator

@divagant-martian divagant-martian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm now convinced

@Frando Frando enabled auto-merge February 20, 2026 16:12
@Frando Frando added this pull request to the merge queue Feb 20, 2026
Merged via the queue into main with commit 88cf95f Feb 20, 2026
59 of 60 checks passed
@Frando Frando deleted the Frando/close-path branch February 20, 2026 17:18
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in iroh Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Bring back PathEvent::Closed

4 participants