diff --git a/Cargo.lock b/Cargo.lock index 7353976fe5a..c13a5af6b98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2276,7 +2276,7 @@ dependencies = [ [[package]] name = "iroh-quinn" version = "0.14.0" -source = "git+https://github.com/n0-computer/quinn?branch=main-iroh#67df91c6670cc48ff2043563e4da388541b4e20b" +source = "git+https://github.com/n0-computer/quinn?branch=arqu%2Ffix_close_delay#29eaf7cf4d089fbc15b26e0ea277132a72c818f5" dependencies = [ "bytes", "cfg_aliases", @@ -2296,7 +2296,7 @@ dependencies = [ [[package]] name = "iroh-quinn-proto" version = "0.13.0" -source = "git+https://github.com/n0-computer/quinn?branch=main-iroh#67df91c6670cc48ff2043563e4da388541b4e20b" +source = "git+https://github.com/n0-computer/quinn?branch=arqu%2Ffix_close_delay#29eaf7cf4d089fbc15b26e0ea277132a72c818f5" dependencies = [ "bytes", "fastbloom", @@ -2321,7 +2321,7 @@ dependencies = [ [[package]] name = "iroh-quinn-udp" version = "0.6.0" -source = "git+https://github.com/n0-computer/quinn?branch=main-iroh#67df91c6670cc48ff2043563e4da388541b4e20b" +source = "git+https://github.com/n0-computer/quinn?branch=arqu%2Ffix_close_delay#29eaf7cf4d089fbc15b26e0ea277132a72c818f5" dependencies = [ "cfg_aliases", "libc", diff --git a/Cargo.toml b/Cargo.toml index dbec80e8080..179df6f88a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,10 +43,9 @@ unused-async = "warn" [patch.crates-io] -iroh-quinn = { git = "https://github.com/n0-computer/quinn", branch = "main-iroh" } -iroh-quinn-proto = { git = "https://github.com/n0-computer/quinn", branch = "main-iroh" } -iroh-quinn-udp = { git = "https://github.com/n0-computer/quinn", branch = "main-iroh" } - +iroh-quinn = { git = "https://github.com/n0-computer/quinn", branch = "arqu/fix_close_delay" } +iroh-quinn-proto = { git = "https://github.com/n0-computer/quinn", branch = "arqu/fix_close_delay" } +iroh-quinn-udp = { git = "https://github.com/n0-computer/quinn", branch = "arqu/fix_close_delay" } netwatch = { git = "https://github.com/n0-computer/net-tools", branch = "main" } # iroh-quinn = { path = "../quinn/quinn" } @@ -56,4 +55,4 @@ netwatch = { git = "https://github.com/n0-computer/net-tools", branch = "main" } # [patch."https://github.com/n0-computer/quinn"] # iroh-quinn = { path = "../quinn/quinn" } # iroh-quinn-proto = { path = "../quinn/quinn-proto" } -# iroh-quinn-udp = { path = "../quinn/quinn-udp" } +# iroh-quinn-udp = { path = "../quinn/quinn-udp" } \ No newline at end of file diff --git a/iroh-relay/Cargo.toml b/iroh-relay/Cargo.toml index 7a88b7539d2..42a8e2016d5 100644 --- a/iroh-relay/Cargo.toml +++ b/iroh-relay/Cargo.toml @@ -42,8 +42,8 @@ postcard = { version = "1", default-features = false, features = [ "use-std", "experimental-derive", ] } -quinn = { package = "iroh-quinn", git = "https://github.com/n0-computer/quinn", branch = "main-iroh", default-features = false, features = ["rustls-ring"] } -quinn-proto = { package = "iroh-quinn-proto", git = "https://github.com/n0-computer/quinn", branch = "main-iroh" } +quinn = { package = "iroh-quinn", git = "https://github.com/n0-computer/quinn", branch = "arqu/fix_close_delay", default-features = false, features = ["rustls-ring"] } +quinn-proto = { package = "iroh-quinn-proto", git = "https://github.com/n0-computer/quinn", branch = "arqu/fix_close_delay" } rand = "0.9.2" reqwest = { version = "0.12", default-features = false, features = [ "rustls-tls", diff --git a/iroh/Cargo.toml b/iroh/Cargo.toml index fbfce9bccee..7a7f7103a16 100644 --- a/iroh/Cargo.toml +++ b/iroh/Cargo.toml @@ -35,9 +35,9 @@ n0-watcher = "0.6" netwatch = { version = "0.12" } pin-project = "1" pkarr = { version = "5", default-features = false, features = ["relays"] } -quinn = { package = "iroh-quinn", git = "https://github.com/n0-computer/quinn", branch = "main-iroh", default-features = false, features = ["rustls-ring"] } -quinn-proto = { package = "iroh-quinn-proto", git = "https://github.com/n0-computer/quinn", branch = "main-iroh" } -quinn-udp = { package = "iroh-quinn-udp", git = "https://github.com/n0-computer/quinn", branch = "main-iroh" } +quinn = { package = "iroh-quinn", git = "https://github.com/n0-computer/quinn", branch = "arqu/fix_close_delay", default-features = false, features = ["rustls-ring"] } +quinn-proto = { package = "iroh-quinn-proto", git = "https://github.com/n0-computer/quinn", branch = "arqu/fix_close_delay" } +quinn-udp = { package = "iroh-quinn-udp", git = "https://github.com/n0-computer/quinn", branch = "arqu/fix_close_delay" } rand = "0.9.2" reqwest = { version = "0.12", default-features = false, features = [ "rustls-tls", @@ -82,7 +82,7 @@ hickory-resolver = "0.25.1" igd-next = { version = "0.16", features = ["aio_tokio"] } netdev = { version = "0.39.0" } portmapper = { version = "0.12", default-features = false } -quinn = { package = "iroh-quinn", git = "https://github.com/n0-computer/quinn", branch = "main-iroh", default-features = false, features = ["runtime-tokio", "rustls-ring"] } +quinn = { package = "iroh-quinn", git = "https://github.com/n0-computer/quinn", branch = "arqu/fix_close_delay", default-features = false, features = ["runtime-tokio", "rustls-ring"] } tokio = { version = "1", features = [ "io-util", "macros", diff --git a/iroh/bench/Cargo.toml b/iroh/bench/Cargo.toml index 3cd1f635974..8f2be579ba7 100644 --- a/iroh/bench/Cargo.toml +++ b/iroh/bench/Cargo.toml @@ -12,7 +12,7 @@ iroh = { path = "..", default-features = false } iroh-metrics = { version = "0.37", optional = true } n0-future = "0.3.0" n0-error = "0.1.0" -quinn = { package = "iroh-quinn", git = "https://github.com/n0-computer/quinn", branch = "main-iroh" } +quinn = { package = "iroh-quinn", git = "https://github.com/n0-computer/quinn", branch = "arqu/fix_close_delay" } rand = "0.9.2" rcgen = "0.14" rustls = { version = "0.23.33", default-features = false, features = ["ring"] } diff --git a/iroh/src/magicsock.rs b/iroh/src/magicsock.rs index e4d3ad11a09..4298a23c2f6 100644 --- a/iroh/src/magicsock.rs +++ b/iroh/src/magicsock.rs @@ -979,6 +979,11 @@ impl Handle { #[instrument(skip_all)] pub(crate) async fn close(&self) { trace!(me = ?self.public_key, "magicsock closing..."); + + // Set closing flag BEFORE wait_idle() to prevent new net_report runs + // from creating QAD connections while we're draining existing ones. + self.msock.closing.store(true, Ordering::Relaxed); + // Initiate closing all connections, and refuse future connections. self.endpoint.close(0u16.into(), b""); @@ -1002,7 +1007,6 @@ impl Handle { if self.msock.is_closed() { return; } - self.msock.closing.store(true, Ordering::Relaxed); self.shutdown_token.cancel(); // MutexGuard is not held across await points