Skip to content

Close the stream writer after input failure - #160

Merged
tony merged 2 commits into
masterfrom
fix/74-stream-shutdown
Dec 5, 2026
Merged

tony merged 2 commits into
masterfrom
fix/74-stream-shutdown

Conversation

@tony

@tony tony commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Closes #74
Closes #92

What changed, and why:

Concurrent close calls share writer cleanup. The original read error or caller cancellation reaches the caller after cleanup, and the final synchronized frame is released.

Checks run:

On Linux, Ruff formatting and lint, ty for Python 3.12 through 3.15, the full pytest suite with doctests, compiled Ghostty comparisons, and the Sphinx warnings-as-errors build passed.

Tool use:

Codex prepared the change and ran the local checks. A separate Codex reviewer replayed the changed behavior and checked the publication tree against the reviewed patch.

tony added a commit that referenced this pull request Dec 3, 2026
why: Readers need the behavior and scope of this change at release.

what:
- Add the unreleased entry for PR #160
- Preserve previously published notes and the parent branch's entries
@tony
tony marked this pull request as ready for review December 3, 2026 01:32
@tony
tony force-pushed the fix/74-stream-shutdown branch from 96cdaee to 58e974b Compare December 3, 2026 23:58
tony added 2 commits December 5, 2026 07:43
why: A failed input pump can strand the independently owned writer.

what:
- Join input and writer tasks under one close operation.
- Propagate read errors and caller cancellation after cleanup.
- Exercise failing reads, cancelled callers and concurrent closes.

Fixes #74
Fixes #92
why: An input error can leave the peer waiting for the stream writer to
     close.

what:
- Describe shared cleanup and the cancellation delivered to a close
  caller.
@tony
tony force-pushed the fix/74-stream-shutdown branch from 58e974b to d1cfd1f Compare December 5, 2026 13:44
@tony
tony changed the base branch from master to fix/72-observe-committed-frames December 5, 2026 13:44
@tony
tony changed the base branch from fix/72-observe-committed-frames to master December 5, 2026 13:49
@tony
tony merged commit 72c226b into master Dec 5, 2026
9 checks passed
@tony
tony deleted the fix/74-stream-shutdown branch December 5, 2026 20:41

This branch was successfully deployed

1 active deployment
docs — d1cfd1f7 Deployed Dec 5, 2026 by tony via build (3.14) #424
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Closing a stream can swallow cancellation of its caller A failed input pump prevents aclose() from closing its writer

1 participant