Skip to content

Report outbound writes interrupted by close - #162

Merged
tony merged 2 commits into
masterfrom
fix/81-interrupted-drain
Dec 5, 2026
Merged

tony merged 2 commits into
masterfrom
fix/81-interrupted-drain

Conversation

@tony

@tony tony commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Closes #81

What changed, and why:

AsyncTerminalStream.drain() and PtySession.drain() raise OSError with errno.ECANCELED when close discards queued bytes. Drain input before close when the child needs those writes.

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 #162
- Preserve previously published notes and the parent branch's entries
@tony
tony marked this pull request as ready for review December 3, 2026 01:35
@tony
tony force-pushed the fix/81-interrupted-drain branch from 9a81dd4 to ba0e2ef Compare December 3, 2026 23:58
tony added 2 commits December 5, 2026 07:43
why: Drain can report success after close discards queued bytes.

what:
- Report local write interruption through errno.ECANCELED.
- Reject PTY writes during close.
- Exercise both streaming transports under backpressure.

Fixes #81
why: Closing a transport with queued input can prevent the child from
     receiving it.

what:
- Document ECANCELED and show how to drain before closing.
@tony
tony force-pushed the fix/81-interrupted-drain branch from ba0e2ef to 9bc09ee Compare December 5, 2026 13:44
@tony
tony changed the base branch from master to fix/109-successor-stream-replies December 5, 2026 13:44
@tony
tony changed the base branch from fix/109-successor-stream-replies to master December 5, 2026 13:50
@tony
tony merged commit 8f4554a into master Dec 5, 2026
16 of 17 checks passed
@tony tony mentioned this pull request Dec 5, 2026
35 of 38 tasks
@tony
tony deleted the fix/81-interrupted-drain branch December 5, 2026 20:41

This branch was successfully deployed

1 active deployment
docs — 9bc09ee5 Deployed Dec 5, 2026 by tony via build (3.14) #428
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.

An interrupted drain() can report success with a queued write lost

1 participant