GeezerVison is showing github.com — 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 · Issue #2084 · developing-today/code
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 #2084Labels app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item DescriptionProblem
The two frame-answering Iroh acceptors in pkgs/id handle streams strictly one at a time, with no deadline on any stream:
pkgs/id/src/envelope_net.rs:137-160 — answer_frames loops while let Ok((mut send, mut recv)) = conn.accept_bi().await and awaits read_frame(&mut recv) (line 143) and then receive(body) inline before accepting the next stream. There is no timeout anywhere in the function.
answer_frames is the shared accept path for both live protocols: EnvelopeProtocol (/id-envelope/1, envelope_net.rs:125-135) and ArtifactPushProtocol (/id-artifact-push/1, pkgs/id/src/artifact.rs:779). Both are registered in id serve (pkgs/id/src/commands/serve.rs:962,966).
crate::frames::read_frame caps the frame size (1 MiB, frames.rs) but waits indefinitely for the length prefix / body bytes to arrive.
So a peer that opens a bidirectional stream and sends nothing — or trickles a partial frame — stalls that connection's handler forever: no later stream on the connection is ever read, and the handler task (plus the receive-side work queued behind the stuck stream) never progresses. A slow receive() (directory apply) blocks the next stream the same way.
Why this is the outlier
The send side of the same module is deadline-bound: send_within wraps the whole delivery, address lookup included, in TIMEOUT = 30 s (envelope_net.rs:29, send_within). The receive side has no counterpart.
The sibling sync protocol does both things answer_frames does not (pkgs/id/src/log_sync.rs):
SyncProtocol::accept (lines ~200-217) spawns each accepted stream into a JoinSet, so one stream cannot starve the next.
answer() wraps the session in timeout(deadline, session) with SESSION_DEADLINE = 60 s (log_sync.rs:59).
Why it matters
/id-envelope/1 and /id-artifact-push/1 are served to Iroh peers — the peer is not the local user. An idle or trickling stream is free to create and currently pins a connection handler indefinitely while silently black-holing every subsequent envelope/artifact on that connection (the sender's own 30 s timeout fires, the outbox retries, and each retry can land behind the same stuck stream shape on a fresh connection the peer keeps stalling). It's a small availability/robustness hole with an established in-repo pattern for the fix.
Evidence (verified this run, main 17249b0)
Acceptance criteria
- A stream on
/id-envelope/1 or /id-artifact-push/1 that does not deliver a complete frame within a bounded deadline (triage pins the value — sender-side 30 s or log_sync's 60 s are the in-repo precedents) 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).
- Regression test: a peer that opens a stream and sends nothing (or a partial frame) does not prevent a second stream's envelope/artifact from being answered; the stalled stream is closed at the deadline.
- Existing
envelope_net and artifact protocol tests still pass; well-behaved one-frame-per-stream senders (the current deliver/push clients) 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-code-b
- Session / ID: new-issue-creator-code-b run 2026-10-29T02:02Z
- Found via: filed this run
- Task: Triage the envelope/artifact-push acceptor stall: answer_frames handles streams sequentially with no per-stream deadline, so an idle/trickling peer stream blocks the whole connection.
- Expectation: effort/s — done when each stream has a bounded deadline and one stalled stream cannot block later streams on the same connection, with a regression test (silent first stream, second stream still answered).
- Links: evidence in issue body; contrast pkgs/id/src/log_sync.rs SESSION_DEADLINE (60s, line 59) + JoinSet-per-stream accept
dezren39 commented on Nov 2, 2026
🤖 Agent note · picked up for metadata-only ownership revalidation
dezren39 commented on Nov 2, 2026
🤖 Agent note · parked — Drew-owned canonical PR remains open
dezren39 commented on Nov 2, 2026 🤖 Agent note · picked up
- Agent: queue worker (repo-worker-code), lane A shift
- Session / ID: task 5080 (repo-queue-worker-shift, 2026-11-02 08:04 CST run)
- Found via: queue claim · resume of parked task 5080
- Task: Resuming PR fix(id): bound envelope acceptor streams #4065 (branch queue/5080-2084-envelope-stream-deadline, head 5f5f618). The prior park cited Drew ownership from author/assignee alone; fresh label evidence overturns it — no held / user/owned / do-not-merge / do-not-auto-edit labels on issue 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 or PR fix(id): bound envelope acceptor streams #4065, and PR fix(id): bound envelope acceptor streams #4065 is task 5080's own queue branch. Diff reviewed fresh: per-stream 30s deadline wraps frame read + receive + reply write, timed-out streams are reset/stopped, ordering stays sequential, the deadline is injectable in tests, and the regression test (partial first frame, valid second stream) is present; the Codex P2 (lease safety under callback timeout) is fixed via
SlotLeaseGuard and its thread is resolved. CI note: run 41383165814's basic tier failed across ALL formatters including languages this diff cannot touch (prettier/biome/shfmt/web) while guard + world snapshot passed — a base/flake-level failure, not this change; the run has been re-queued into the backlog. Merging under the standing merge authority (verify the change itself sound; note the infra problem).
- Expectation: s — done = PR fix(id): bound envelope acceptor streams #4065 merged, 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 closed, task 5080 completed; the re-queued CI run confirms afterwards (fix-forward if it isolates a real failure in this change).
- Links: PR fix(id): bound envelope acceptor streams #4065, issue 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
dezren39 commented on Nov 2, 2026
MetadataMetadataapp/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item DevelopmentNo branches or pull requestsIssue actions
|