Skip to content

fix: stop POSIX preview input at its parent deadline - #5553

Open
huangruiteng wants to merge 1 commit into
mainfrom
codex/fix-preview-backpressure-cleanup-20261004
Open

huangruiteng wants to merge 1 commit into
mainfrom
codex/fix-preview-backpressure-cleanup-20261004

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

A backpressured preview send can report its parent timeout while the background pipe writer remains alive. When reader capacity returns, that writer can finish a complete request frame after the deadline. The real-pipe counterexample fails on main for both 64 KiB and 512 KiB inputs.

Use nonblocking POSIX pipe writes and readiness waits against the original monotonic deadline. Timeout leaves no background input writer to finish the frame or retain the write end during cleanup. Keep the existing Windows pipe path, TS Host/process-group cleanup, retirement fence and retry rules. This is a transport repair under S4/S10 and R1 recovery; it creates no queue, runner, authority or protocol vocabulary.

Validation on macOS / Node 24.21.0 / Python 3.12.15:

  • Before/after counterexample: 2 failures on the original main implementation, 2 passes with the fix.
  • Preview reuse and local delegation suites: 70 passed, one upstream settings forward-reference warning. The original paused-supervisor deadline and partial-frame EOF checks pass.
  • Native preview/Host/process-group tests: 24 passed; control-plane typecheck, Chat build, Ruff and configured Mypy (19 files) passed. Chat build retains its existing chunk-size warning.
  • Semantic advisory found no supported new vocabulary carriers; exact two-path premerge passed 5 direct and 10 selected checks, including full semantic drift and maintainability. Final diff/public-boundary checks passed.
  • Fresh isolated installed wheel: both input sizes reject a late complete frame; a paused supervisor times out, exits through its original owner, and a fresh preview works after cleanup. All 10 loaded LoopX modules come from the wheel. Metadata version remains 1.2.4; source revision is recorded separately. The first build correctly rejected missing Chat assets; rebuilding after the standard Chat build passed.

This independently targets main 99839aeb8fed5fae38a5d319391cd050672a6508. It does not include the separate retirement-clock change in #5550. The previous Linux CI cleanup timeout is still not attributed or waived by the macOS counterexample; exact-head Linux/Windows CI and maintainer review remain required. Tests use synthetic processes/configuration. The running source candidate and formal installation were not changed by this validation.

Signed-off-by: huangruiteng <huangrt01@163.com>

This branch has not been deployed

No deployments
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