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 — fleet-proxy(stdio): relay never exits after remote close while stdin stays open — up.join() waits on a stdin-blocked thread · Issue #5518 · developing-today/code

fleet-proxy(stdio): relay never exits after remote close while stdin stays open — up.join() waits on a stdin-blocked thread #5518

New issue
Copy link
New issue
Copy link
Closed
#5520
Closed
fleet-proxy(stdio): relay never exits after remote close while stdin stays open — up.join() waits on a stdin-blocked thread#5518
#5520
Copy link
Labels
app/fleetpkgs/fleet multicall binary + platform crateskind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

@dezren39
dezren39
opened on Nov 4, 2026
Issue body actions

Bug: fleet proxy connect --stdio never exits after the remote side closes, when stdin stays open

pkgs/fleet/crates/fleet-proxy/src/stdio.rs, relay_stdio (merged in step 3, PR #5515):

let up = std::thread::spawn(move || {
    let mut stdin = std::io::stdin().lock();
    pump(&mut stdin, &mut inbound);
    let _ = inbound.shutdown(std::net::Shutdown::Write);
});
// tunnel → stdout on this thread.
let mut stdout = std::io::stdout().lock();
pump(&mut tunnel, &mut stdout);
drop(tunnel);
let _ = up.join();   // <-- blocks until stdin reaches EOF
Ok(0)

When the tunnel side closes first (server closes / SSH session ends), the
download pump returns — but up.join() then waits for the upload thread,
which is blocked in stdin.read() and also holds the try_clone() of the
socket, so drop(tunnel) closes nothing. The process hangs until stdin
also reaches EOF. As an SSH ProxyCommand this wedges session teardown:
the remote is gone, the bytes are delivered, and the relay process never
exits.

Verified this run (laptop probe, real crate @ main 5521f3f)

Probe crate ~/git/fleet/probe-stdio-hang (path-dep on the real
fleet-proxy, default-features = false) calling
relay_stdio in direct mode against a loopback server that sends
hello-from-server\n and closes:

  • Case A — stdin held open (pipe write-end open, no data, no EOF):
    stdout received hello-from-server, then the process hung;
    timeout 6 killed it (exit 124).
  • Case B — control, stdin at EOF (< /dev/null): exit 0 promptly,
    same bytes delivered.

Why it matters

--stdio exists to be SSH's ProxyCommand. A ProxyCommand that outlives
the connection leaks a process per dead session and can stall ssh
exit; the Python relay it replaces exits when either side is done.

Acceptance criteria

  • When the tunnel reaches EOF/errors, relay_stdio returns promptly
    even if stdin is still open with no data.
  • The stdin-EOF-first half-close behavior is preserved: stdin EOF
    still shutdown(Write)s the tunnel and the download side drains
    until the remote closes.
  • Probe case A above exits 0 within ~1s of the server closing;
    case B unchanged.
  • cargo test -p fleet-proxy green.

Activity

  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    status/in-progressQueue worker lifecycle state
    on Nov 4, 2026
  2. developing-today commented on Nov 4, 2026

    @developing-today
    developing-todayBot
    on Nov 4, 2026 – with developing.today
    Contributor
    More actions

    CODE-1347

  3. dezren39
    added
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    work/self-assignedAn agent grabbed this item directly, outside the queue
    app/fleetpkgs/fleet multicall binary + platform crates
    on Nov 4, 2026
  4. dezren39 commented on Nov 4, 2026

    @dezren39
    dezren39
    on Nov 4, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (new-issue-creator-code-b, Lane B)
    • Session / ID: cron new-issue-creator-code-b, 2026-11-04 08:50 CST run
    • Found via: filed this run
    • Task: Filed after verifying behaviorally with a probe crate against the real fleet-proxy crate on the laptop (probe ~/git/fleet/probe-stdio-hang @ main 5521f3f): with the tunnel closed by the server and stdin held open, relay_stdio hangs (timeout-killed at 6s) because it joins an upload thread blocked in stdin.read(); the stdin-EOF control exits 0 promptly.
    • Expectation: effort xs — guarded self-solve this run: stop joining the stdin-blocked upload thread when the download side ends in relay_stdio (pkgs/fleet/crates/fleet-proxy/src/stdio.rs), preserving the stdin-EOF half-close; re-probe both cases + cargo test -p fleet-proxy, PR + merge when green.
    • Links: branch creator-b/5518-stdio-relay-exit (to come)
  5. developing-today
    added
    status:in-review
    on Nov 4, 2026
  6. dezren39
    added a commit that references this issue on Nov 4, 2026

    fix(fleet-proxy): stdio relay exits when the tunnel closes (#5518) (#…

    4fb0927
  7. dezren39
    closed this as completedin #5520on Nov 4, 2026
  8. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 4, 2026
  9. dezren39 commented on Nov 4, 2026

    @dezren39
    dezren39
    on Nov 4, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: new-issue-creator job (new-issue-creator-code-b, Lane B)
    • Session / ID: cron new-issue-creator-code-b, 2026-11-04 08:50 CST run
    • Found via: filed this run
    • Task: Guarded self-solve complete — PR fix(fleet-proxy): stdio relay exits when the tunnel closes (#5518) #5520 squash-merged (4fb0927): relay_stdio no longer joins the stdin-blocked upload thread after the tunnel side ends; it shuts the socket down and detaches the thread, so the relay exits when either side is done. The stdin-EOF half-close path is unchanged.
    • Expectation: done — cargo test -p fleet-proxy --all-features green on the laptop (8 passed), fmt applied, single-file diff (+10/−1); fixed crate re-probed (probe ~/git/fleet/probe-stdio-fixed): remote-close + stdin-held-open now exits 0 in 17 ms (was a hang, timeout-killed at 6 s pre-fix), and the half-close control (stdin EOF first, server replies after) still delivers echo:ping, exit 0.
    • Links: PR fix(fleet-proxy): stdio relay exits when the tunnel closes (#5518) #5520 (merged), branch creator-b/5518-stdio-relay-exit (deleted on merge)
  10. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    work/self-assignedAn agent grabbed this item directly, outside the queue
    on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/fleetpkgs/fleet multicall binary + platform crateskind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    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.