From a687e0c2b840ba7b841ab34389db10363e896972 Mon Sep 17 00:00:00 2001 From: ddidderr Date: Sat, 12 Sep 2026 13:22:51 +0200 Subject: [PATCH] fix(peer): preserve control capacity across origins Set the per-origin control-stream share to eight against the sixteen-slot global pool, preventing one observed host from occupying every decoded control task. Test Plan: - just test - just clippy - exact admission-limit regression - git diff --check --- crates/lanspread-peer/src/services/server.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/lanspread-peer/src/services/server.rs b/crates/lanspread-peer/src/services/server.rs index 19dc273..a5f2c4a 100644 --- a/crates/lanspread-peer/src/services/server.rs +++ b/crates/lanspread-peer/src/services/server.rs @@ -52,7 +52,7 @@ const MAX_GLOBAL_STREAM_INSTALL_TASKS: usize = 2; /// One observed host may retain only this many established connection scopes. const MAX_ESTABLISHED_CONNECTIONS_PER_ORIGIN: usize = 8; /// Bounds decoded and undecoded control work across every connection from one IP. -const MAX_CONTROL_STREAM_TASKS_PER_ORIGIN: usize = 16; +const MAX_CONTROL_STREAM_TASKS_PER_ORIGIN: usize = 8; /// Preserves bulk capacity for other LAN origins while allowing two full /// four-stream ordinary download windows from one host. const MAX_BULK_TRANSFER_TASKS_PER_ORIGIN: usize = 8; @@ -717,7 +717,7 @@ mod tests { assert_eq!(MAX_GLOBAL_BULK_TRANSFER_TASKS, 48); assert_eq!(MAX_GLOBAL_STREAM_INSTALL_TASKS, 2); assert_eq!(MAX_ESTABLISHED_CONNECTIONS_PER_ORIGIN, 8); - assert_eq!(MAX_CONTROL_STREAM_TASKS_PER_ORIGIN, 16); + assert_eq!(MAX_CONTROL_STREAM_TASKS_PER_ORIGIN, 8); assert_eq!(MAX_BULK_TRANSFER_TASKS_PER_ORIGIN, 8); assert_eq!(MAX_STREAM_INSTALL_TASKS_PER_ORIGIN, 1); assert_eq!(