Repository navigation
docs(design): DASYNC.2 tokio async listener bridge design (#3983) - #5628
Merged
Merged
Conversation
Specifies the bridge from tokio::net::TcpListener::accept to the existing synchronous handle_session() worker. The hybrid skeleton at crates/daemon/src/async_listener.rs:73 already accepts streams; this design replaces the drop-on-accept closure at daemon.rs:411-418 with a spawn_blocking + handle_session dispatch gated by a tokio::sync::Semaphore sized to --max-connections. Covers architecture, key invariants, back-pressure model (eager @error refusal preserving upstream wire bytes), bridge to existing TLS / LSM / cap-admission overlays, sub-task ladder for DASYNC.3, test plan, rollback criteria, and cross-references to DASYNC.1.
oferchen
force-pushed
the
docs/dasync-2-tokio-async-listener-design
branch
from
June 10, 2026 20:11
d838c37 to
41be7b5
Compare
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…ener-design docs(design): DASYNC.2 tokio async listener bridge design (#3983)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tokio::net::TcpListener::acceptto the existing synchronoushandle_session()worker; DASYNC.3 is a wiring change, not greenfield.crates/daemon/src/daemon.rs:411-418with aspawn_blocking + handle_sessiondispatch gated by atokio::sync::Semaphoresized to--max-connections.@ERROR: max connections (N) reached -- try again laterrefusal preserves upstream wire bytes; locks bridge contract for TLS / LSM / cap-admission overlays.Document
docs/design/dasync-2-tokio-async-listener.mdcovers:into_std()->spawn_blocking(handle_session)).OwnedSemaphorePermitoutlives worker, panic isolation parity).spawn_blocking), LSM-CAP (startup, unchanged), LSM-SECCOMP (per-worker prologue), Landlock (transfer prologue, unchanged),--max-connectionsadmission move.spawn_blockingoverhead at N=1K, pool size vs cap, single vs dual feature flag, dual-stack accept).Cross-references
@ERROR:refusal byte format.Test plan