Repository navigation
fix: avoid native SIGPIPE handlers on HTTP disconnect - #215
Draft
gspark-etri wants to merge 2 commits into
Draft
gspark-etri wants to merge 2 commits into
gspark-etri wants to merge 2 commits into
Conversation
This was referenced Oct 23, 2026
gspark-etri
added a commit
that referenced
this pull request
Oct 30, 2026
…214, #229, #241) (#281) - llmd: HTTP handler writes via MSG_NOSIGNAL so a client disconnect raises BrokenPipeError instead of hitting a vendor SIGPIPE handler (#215). - serve_batched: add the tokenizer EOS to generation_config EOS ids (#230); --pd-prefill-chunk / --pd-prefill-no-prefix-cache for the Torch producer (#242). - test that serve_stage's handler actually writes through the no-signal writer. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Closing an HTTP stream while the ATOM SDK is loaded invokes its native SIGPIPE handler, producing backtraces even though Python subsequently handles BrokenPipeError. The SDK changes the native disposition without updating Python's signal inspection state.
Changes
Use an unbuffered HTTP socket writer with MSG_NOSIGNAL per write. Preserve BrokenPipeError, byte count and file descriptor behavior; do not change process-global signal handlers. Add regression tests and hardware evidence. This PR is stacked on #210.
Verification
PYTHONPATH=opt_prime python3 -m pytest -q opt_prime/tests/test_http_sigpipe.py opt_prime/tests/test_serve_batched.py opt_prime/tests/test_pd_http_cancel.py: 14 passed.opt_prime/docs/validation/http214/.Compatibility and limits
Platforms without MSG_NOSIGNAL retain prior flags0 behavior. This is a disconnect robustness fix, not a performance or numerical-accuracy claim. Tests use fixed output length and do not establish semantic quality or hardware batching.
Related Issue
Closes #214. Related to #211 and #201. Full model/backend matrix remains ongoing.
AI-assisted implementation and verification with Codex; maintainer review and merge required.