Skip to content

fix(pty): close master after child exit#519

Merged
wan9chi merged 3 commits into
mainfrom
fix/conpty-eof-deadlock
Jul 9, 2026
Merged

fix(pty): close master after child exit#519
wan9chi merged 3 commits into
mainfrom
fix/conpty-eof-deadlock

Conversation

@wan9chi

@wan9chi wan9chi commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Transfer the PTY master to the child-monitor thread when the child exits.
  • Close the master outside shared locks while the caller drains terminal output.
  • Keep the EOF regression tests holding the writer alive and assert final output is preserved.

Motivation

Before Windows build 26100, ClosePseudoConsole can wait indefinitely unless its output pipe is drained concurrently. The current ownership cycle keeps the pseudoconsole handle in PtyWriter while PtyReader waits for EOF, causing direct PTY tests and the E2E harness to time out on Windows Server 2022 build 20348. Moving master teardown to the existing child-monitor thread follows Microsoft’s required close-and-drain ordering without truncating output.

wan9chi commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@wan9chi

wan9chi commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

Verified on Namespace Windows Server 2022 build 20348 in CI run 28994689990:

  • All nine direct pty_terminal tests passed across the six default shards.
  • cache_disabled::task_with_cache_disabled passed in 183 ms.
  • The complete ignored Windows shard passed in 30 seconds.
  • No 5-second PTY or 60-second E2E timeout remained.

The remaining immediate default-shard failures are the separately documented milestone screen-ordering issue. The temporary Namespace runner change has been removed from the PR.

wan9chi and others added 3 commits July 9, 2026 12:55
Co-authored-by: GPT-5.6 <codex@openai.com>
Co-authored-by: GPT-5.6 <codex@openai.com>
Co-authored-by: GPT-5.6 <codex@openai.com>
@wan9chi
wan9chi force-pushed the fix/conpty-eof-deadlock branch from 570c62b to c87d310 Compare July 9, 2026 04:55

wan9chi commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

Merge activity

  • Jul 9, 5:03 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 9, 5:03 AM UTC: @wan9chi merged this pull request with Graphite.

@wan9chi
wan9chi merged commit 1720432 into main Jul 9, 2026
20 checks passed
@wan9chi
wan9chi deleted the fix/conpty-eof-deadlock branch July 9, 2026 05:03
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.

1 participant