GeezerVison is showing github.com — id(protocol): MetaProtocol accept is sequential with no stream deadline — one idle or trickling stream stalls every meta request on the connection · Issue #2086 · developing-today/code
id(protocol): MetaProtocol accept is sequential with no stream deadline — one idle or trickling stream stalls every meta request on the connection #2086DescriptionProblem
MetaProtocol::accept — the /id-meta/1 handler (META_ALPN) served by id serve — handles streams strictly one at a time, with no deadline on any stream:
pkgs/id/src/protocol.rs:705-727 — the accept loop awaits recv.read_to_end(MAX_REQUEST_BYTES) (line 708) and then self.handle(&remote, req).await inline before accepting the next stream. There is no tokio::time::timeout anywhere in the function, and no per-stream spawn.
read_to_end caps the request size (1 MiB, MAX_REQUEST_BYTES at protocol.rs:238) but waits indefinitely for the peer to finish (or close) the stream. A peer that opens a stream and sends a partial request — or nothing — and never finishes it stalls the loop forever.
- The client side reuses ONE connection per server:
MetaClient::Remote holds a single Connection (pkgs/id/src/meta_client.rs, MetaClient::open/connect_node), and every request goes through request_over(&conn, …) opening a new stream on that same connection. So one stalled stream on a connection black-holes every subsequent meta request (Put/Get/List/Find/Delete/Rename/…) on it, not just one call.
Why this is the outlier
Sibling acceptors in the same crate do both things this one does not:
log_sync.rs — SyncProtocol::accept spawns each stream into a JoinSet and wraps sessions in timeout(SESSION_DEADLINE) (60 s, log_sync.rs:59).
world_net.rs:73-95 — WorldProtocol::accept spawns per-stream sessions under a Semaphore (MAX_SESSIONS_PER_CONNECTION), refusing only the over-limit stream.
world_ssh.rs:123 — SshTunnelProtocol spawns per stream under a semaphore.
event_sync.rs:40,48 — sessions bounded by SESSION_DEADLINE (60 s) and even the post-session close wait is bounded (CLOSE_WAIT 5 s).
Related but distinct: #2084 covers the envelope + artifact-push acceptors (answer_frames). The meta protocol does not use answer_frames and is not in that issue's scope — it is the remaining sequential, deadline-free acceptor in id serve's router (serve.rs:941).
Why it matters
The meta protocol is the primary request path into a running id serve — local CLI/REPL clients and remote peers both use it. An idle or trickling stream is free for any connected peer to create and currently pins the connection's handler indefinitely; because clients multiplex all their requests over that one connection, the failure mode is a silent total stall of that client's meta operations, with no error and no recovery short of reconnecting.
Evidence (verified this run, main 39e8410)
- Read
protocol.rs:705-727 directly: sequential loop, inline read_to_end + handle awaits, no timeout, no spawn.
- Read
meta_client.rs: MetaClient::Remote holds one Connection; request_over opens a stream per request on it.
- Contrast reads: log_sync.rs:59 + JoinSet accept; world_net.rs:73-95; world_ssh.rs:123-147; event_sync.rs:40-48,136.
- Enumerated every
ProtocolHandler impl in pkgs/id/src: MetaProtocol is the only production acceptor that is both sequential and deadline-free besides the two in id(envelope_net): envelope + artifact-push acceptors answer streams one at a time with no deadline — an idle or trickling peer stream stalls the whole connection forever #2084 (ArtifactPull is filed separately — its waits are single-stream and its close-wait is unbounded, a different shape).
- Dedup:
gh issue list --state all searches for "MetaProtocol", "meta protocol stall", "answer_frames" returned no existing issue for this (closest: id(envelope_net): envelope + artifact-push acceptors answer streams one at a time with no deadline — an idle or trickling peer stream stalls the whole connection forever #2084, envelope/artifact-push only; id: match_kind is defined four times — CLI, REPL, protocol and a dead helpers copy can silently diverge #697, closed, unrelated match_kind duplication).
Acceptance criteria
- A meta stream that does not deliver a complete request within a bounded deadline (triage pins the value — log_sync/event_sync's 60 s is the in-repo precedent) is abandoned/closed, and the acceptor moves on.
- One stalled or slow stream no longer blocks later streams on the same connection (per-stream spawn, or an equivalent structure; a per-connection concurrency bound like world_net's semaphore is welcome).
- Regression test: a peer that opens a stream and sends nothing (or a partial request) does not prevent a second stream's request from being answered; the stalled stream is closed at the deadline.
- Existing protocol/meta tests still pass; well-behaved one-request-per-stream clients (the current
request_over paths) are unaffected.
Activitydeveloping-today commented on Oct 29, 2026 added kind/bugSomething isn't working (prefixed form of the classic bug label) task/triageQueue packet kind: verify, reproduce, and route this item app/idPackage/app: id (pkgs/ or apps/ in this repo) effort/sSmall: expected under 2 hours of work on Oct 29, 2026dezren39 commented on Oct 29, 2026 🤖 Agent note · filed
- Agent: new-issue-creator job (lane A, new-issue-creator-code-a)
- Session / ID: cron new-issue-creator-code-a run 2026-10-29T02:05Z
- Found via: filed this run
- Task: Filed after verifying on main 39e8410 that MetaProtocol::accept (protocol.rs:705-727) is sequential with no stream deadline, unlike the log_sync/world_net/world_ssh/event_sync acceptors; enqueued a triage packet to pin the deadline + concurrency structure.
- Expectation: effort/s — triage pins the deadline value and spawn/semaphore structure, then routes a small_fix packet with a stalled-stream regression test.
- Links: packet queue-pilot/packet-2086-triage.json (repo-health-code-pilot)
dezren39 commented on Nov 2, 2026 agent-note:v1
event: parked
task: 5081 (repo-health-code-pilot, repo-worker-code — OpenChamber scheduled lane)
state: Parked for 30 minutes after fresh metadata-only revalidation.
fresh_evidence: #2086 remains OPEN and assigned to dezren39 (Drewry Pope); task-bound PR #4240 remains OPEN and authored by dezren39.
hard_stop: Prior checkpoint forbids inspecting or modifying PR #4240 contents, branch/worktree, CI, reviews, or test log. No repository artifacts accessed or changed.
resume: After explicit handoff/release or PR #4240 closes/merges; revalidate issue and PR metadata before proceeding.
bookkeeping: Sandbox backlog and sweep log deferred to fleet reconciliation. dezren39 commented on Nov 2, 2026 dezren39 commented on Nov 2, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|