gabriel / muse public
fix minor transport fix/sigpipe-large-push #1 / 1
gabriel · 61 days ago · Apr 10, 2026 · Diff

fix(transport): ignore SIGPIPE during HTTP I/O to survive early server close on large pushes

app.py sets SIGPIPE=SIG_DFL at startup so that piping 'muse log | head' exits cleanly. This same disposition kills the process (exit 141) when the server closes the connection while the client is still uploading a large request body — e.g. a 60+ MB push bundle that triggers a 409 conflict or a 401 auth failure.

Fix: _open_url() now temporarily sets SIGPIPE=SIG_IGN for the duration of the HTTP call via the new _ignore_sigpipe() context manager. Broken- pipe conditions surface as TransportError('Connection reset by peer' or 'Broken pipe') instead of killing the process.

Tests: 3 regression tests in TestSigpipeRegression spin a minimal TCP server that sends a 4xx response after headers and closes immediately, then verify TransportError is raised regardless of SIGPIPE disposition.

sha256:a34925bfdd33f1794a68ad51c89caa321e39bdea34e0c8cef5aea8e20e1cb28e sha
sha256:ed24ce3115fe6677287b4e32494ea19802bbf8839ebcb29343199eebd958d196 snapshot
← Older Oldest on fix/sigpipe-large-push
All commits
Newer → Latest on fix/sigpipe-large-push

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:a34925bfdd33f1794a68ad51c89caa321e39bdea34e0c8cef5aea8e20e1cb28e --body "your comment"