Skip to content

feat(agent,sync): universal control-lane reservation + process-wide disk bound (W2.5) - #50

Merged
rldyourmnd merged 2 commits into
mainfrom
w25-control-lane-disk-bounds
Sep 27, 2026
Merged

rldyourmnd merged 2 commits into
mainfrom
w25-control-lane-disk-bounds

Conversation

@rldyourmnd

Copy link
Copy Markdown
Contributor

Summary

  • service_slots now reserves one stream lane whenever a connection can carry >1 stream, not only in grant mode — a saturated data plane could previously occupy every JoinSet slot and starve even Ping/Info on non-grant connections.
  • Ping, Info, Authz and RenewAuthz greetings bypass the data-service pool; only Tcp/Desktop/Sync/Audio bodies consume it. An over-capacity data greeting gets a timeouts.hello_secs-bounded HelloAck::Error ("service capacity reached; a lane is reserved for control traffic") instead of waiting on the pool.
  • All rds-sync spawn_blocking filesystem work (preflight, opens, manifest/journal, chunk reads) funnels through a static 32-permit DISK_JOBS semaphore acquired on the async side; the long-lived journal store worker holds its permit for its entire lifetime.

Semantics change (test-encoded behavior)

  • Grant-mode renewal_preserves_stream previously asserted Ping fails while TCP holds the sole service slot; it now asserts Ping succeeds — observability through the reserved lane is the intended guarantee.
  • managed_desktop_reports_remote_refusal_without_leaking previously opened 64 TCP streams on a 64-stream connection; it now proves 63 data slots admit, the 64th is refused, and the refused desktop open leaked no permit.

Test plan

  • saturated_data_plane_still_admits_control_streams (new): live TCP + refused 2nd TcpConnect + answered Ping on a 2-stream conn, both backends.
  • disk_jobs_share_one_bounded_pool (new): 64-job storm never exceeds 32 concurrent blocking jobs.
  • cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings (default + rds-desktop/x11 lanes), cargo test --workspace — all green locally.
  • CI lanes

Generated with Devin

rldyourmnd and others added 2 commits September 27, 2026 15:29
…wide

The per-connection stream budget reserved one lane only in grant mode,
so a non-grant connection's long-lived data services could occupy every
JoinSet slot and starve even Ping/Info. The reservation is now
universal: whenever a connection can carry more than one stream, the
service pool is streams - 1, and only long-lived data bodies (Tcp,
Desktop, Sync, Audio) consume it. Ping, Info and the Authz/RenewAuthz
exchanges bypass the pool, so a saturated data plane cannot starve
observability or authorization turnover; an over-capacity data
greeting is refused with a hello-timeout-bounded HelloAck::Error
instead of competing for the lane.

rds-sync filesystem work is funneled through one static 32-permit
semaphore: every spawn_blocking site acquires a permit on the async
side before entering the blocking pool, and the journal store worker
holds its permit for its whole lifetime. A transfer storm can no
longer fill Tokio's blocking pool ahead of identity, revocation and
announcement work.

Tests: a saturated two-stream connection keeps TCP live, refuses a
second TcpConnect and still answers Ping; the grant renewal regression
now asserts Ping reaches through the reserved lane; the managed
desktop refusal test asserts the data budget holds 63 slots and the
64th is refused; a 64-job disk storm never exceeds 32 concurrent
blocking jobs.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@rldyourmnd
rldyourmnd merged commit 416ee71 into main Sep 27, 2026
43 of 48 checks passed
@rldyourmnd
rldyourmnd deleted the w25-control-lane-disk-bounds branch September 27, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant