Skip to content

fix(hosting): boot diagnostics cannot block interpreter exit when stderr stops draining (#1031) - #1051

Merged
antosubash merged 3 commits into
mainfrom
fix/dev-boot-exit-1031
Nov 19, 2026
Merged

antosubash merged 3 commits into
mainfrom
fix/dev-boot-exit-1031

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

Verification

  • Live: uvicorn host.main:app with SM_ENVIRONMENT=development, stderr on a pre-filled 4 KiB blocking pipe that nobody reads, and uvicorn and app logging silenced so the diagnostics writer is the only stderr writer. The app booted (/health 200) and exited 0.3 s after SIGTERM. With uvicorn's own logging left on, the process blocks in uvicorn's main-thread logging; that's outside the framework's control.
  • Review: 3 passes.
    • Pass 1 found 2: a single large write could interleave with concurrent writers and split UTF-8; the Windows console leaked descriptors.
    • Pass 2 found 2: short writes on files and terminals lost output; per-line encoding broke UTF-16 and BOM.
    • All fixed with regression tests: concurrent Unicode through a real pipe, PTY short writes, UTF-16 and utf-8-sig, descriptor stability, and a bounded exit with a full blocking pipe. Pass 3 was clean.
  • Local CI: make lint ✓, make test-js 998 passed, make test-py 9507 passed.

Test plan

  • CI is green

https://claude.ai/code/session_01FXHA3Zj78w6GWaNKoovHq6

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8818af5
Status: ✅  Deploy successful!
Preview URL: https://0fee10f6.simple-module-python.pages.dev
Branch Preview URL: https://fix-dev-boot-exit-1031.simple-module-python.pages.dev

View logs

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-19T04:09:16.508123Z 8818af5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@antosubash antosubash added the shipped /ship passed on the head commit label Nov 19, 2026
@antosubash

Copy link
Copy Markdown
Owner Author

/ship passed on 8818af5
Rounds: 1 of 3
Review: 3 passes; pass 1 found 2 (unbounded single write interleaved/split UTF-8; Windows console fd leak), pass 2 found 2 (short writes on files/ttys lost output; per-line encoding broke UTF-16/BOM), all fixed with regression tests; pass 3 clean.
QA: live dev app with stderr on a pre-filled never-read blocking pipe (uvicorn/app logging silenced): /health 200, exited 0.3 s after SIGTERM.
Local CI: make lint ✓, make test-js 998 passed, make test-py 9507 passed.
CI: PR checks SUCCESS

@antosubash
antosubash merged commit 6be5026 into main Nov 19, 2026
18 checks passed
@antosubash
antosubash deleted the fix/dev-boot-exit-1031 branch November 19, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shipped /ship passed on the head commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev boot: a stderr whose reader never drains can delay interpreter exit

1 participant