GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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 #2084

New issue
Copy link
New issue
Copy link
Closed
#4065
Closed
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
#4065
Copy link
Assignees
dezren39
Labels
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

Description

@dezren39
dezren39
opened on Oct 29, 2026
Issue body actions

Problem

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)

  • Read envelope_net.rs:137-160 directly: sequential loop, inline read_frame + receive awaits, no tokio::time::timeout.
  • Grepped all answer_frames callers: only EnvelopeProtocol::accept and ArtifactPushProtocol::accept (artifact.rs:779); both registered in serve.rs:962,966.
  • Contrast read at log_sync.rs:59 (SESSION_DEADLINE), ~200-217 (JoinSet spawn per stream), ~268/~313 (timeout(deadline, session)).
  • Dedup: gh issue list --state all searches for answer_frames, "envelope idle timeout stream", and slow-loris/idle-connection terms returned no existing issue for this (closest hits were unrelated mcpx testing issues and the distinct collab-WS cap id(web/collab): collab WebSocket has no message-size or step-count cap — a single frame can be 64 MiB and hundreds of thousands of steps, all retained and replayed to every joiner #1965).

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.

Activity

Next
  1. developing-today commented on Oct 29, 2026

    @developing-today
    developing-todayBot
    on Oct 29, 2026 – with developing.today
    Contributor
    More actions

    CODE-999

  2. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Oct 29, 2026
  3. dezren39 commented on Oct 29, 2026

    @dezren39
    dezren39
    on Oct 29, 2026
    MemberAuthor
    More actions

    🤖 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
  4. github-actions
    assigned
    dezren39
    on Oct 29, 2026
  5. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 1, 2026
  6. 150 remaining items

    Load more actions
  7. dezren39
    added
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    on Nov 2, 2026
  8. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up for metadata-only ownership revalidation

    • Agent: queue worker (repo-worker-code), OpenChamber scheduled lane
    • Session / ID: OpenCode session ses_e5e6382f632ffeoXT3muAxJr0w · queue task 5080 (attempt 2)
    • Found via: atomic queue claim; resumed from verified hard-stop checkpoint
    • Fresh metadata: 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 OPEN and assigned to dezren39; sole matching PR fix(id): bound envelope acceptor streams #4065 OPEN, authored/assigned to dezren39 on the task branch.
    • Action: no PR checks/content, branch, worktree, or source inspected; no changes made.
    • Next: park until PR closure or explicit Drew handoff.
  9. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked — Drew-owned canonical PR remains open

    • Agent: queue worker (repo-worker-code), OpenChamber scheduled lane
    • Session / ID: OpenCode session ses_e5e6382f632ffeoXT3muAxJr0w · queue task 5080
    • Evidence: 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 is OPEN and assigned to dezren39; canonical PR fix(id): bound envelope acceptor streams #4065 is OPEN, authored and assigned to dezren39 on queue/5080-2084-envelope-stream-deadline.
    • Disposition: parked until 2026-11-02T14:21:25Z. No PR checks/content, branch, worktree, or source inspected; no changes made. Existing labels already reflect parked state: work/assigned, queue/parked, status/parked.
    • Resume condition: PR fix(id): bound envelope acceptor streams #4065 closes or Drew explicitly hands off ownership; then revalidate before any further access.
  10. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 2, 2026
  11. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 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
  12. dezren39
    closed this as completedin #4065on Nov 2, 2026
  13. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • 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: Done. PR fix(id): bound envelope acceptor streams #4065 merged as 94e4aba (2026-11-02T14:29:17Z); verified on main: answer_frames_within bounds each stream (read + receive + reply write) to the deadline, resets/stops timed-out streams, keeps sequential ordering, and the partial-frame regression test is in the tree; SlotLeaseGuard (the Codex P2 fix) landed with it. Infra note: the PR run's basic tier failed across every formatter including languages untouched by this diff while guard + world snapshot passed — base/flake-level, and the run was re-queued; if the re-run isolates a real failure in this change it is a fix-forward.
    • Expectation: done — closing 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; task 5080 completing.
    • Links: PR fix(id): bound envelope acceptor streams #4065 (merged 94e4aba), 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
  14. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

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

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.