Skip to content

Close the stream writer after input failure - #160

Open
tony wants to merge 2 commits into
masterfrom
fix/74-stream-shutdown
Open

tony wants to merge 2 commits into
masterfrom
fix/74-stream-shutdown

Conversation

@tony

@tony tony commented Dec 3, 2026

Copy link
Copy Markdown
Member

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.

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
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
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.

This branch was successfully deployed

1 active deployment
docs — 58e974b7 Deployed Dec 4, 2026 by tony via build (3.14) #350
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