Skip to content

Exit 13 on unsettled top-level await in the main entry instead of spinning - #36051

Closed
robobun wants to merge 8 commits into
mainfrom
farm/2eaadb90/unsettled-tla-exit-13
Closed

Exit 13 on unsettled top-level await in the main entry instead of spinning#36051
robobun wants to merge 8 commits into
mainfrom
farm/2eaadb90/unsettled-tla-exit-13

Exit 13 on unsettled top-level await in the main entry instead of spi…

263fac4
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 27, 2026 in 31m 10s

Code review found 1 important issue

Found 5 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important src/runtime/cli/run_command.rs:1626-1638 New post-drain check handles only Pending; entry promise Rejected during on_before_exit is dropped

Annotations

Check failure on line 1638 in src/runtime/cli/run_command.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

New post-drain check handles only Pending; entry promise Rejected during on_before_exit is dropped

The new post-`on_before_exit()` check handles only `Pending`; if the entry promise transitions Pending→Rejected inside `on_before_exit()` (e.g. a `beforeExit` listener rejects the awaited promise), `Rejected` falls through here with no action and the process exits 0 with the error swallowed — `JSInternalPromise` rejections don't reach `handle_rejected_promises()`. The worker path this mirrors does the full tri-state check in one place (web_worker.rs:1112-1135); add a `Rejected` arm here that rou