Skip to content

Exit unsettled top-level await instead of hanging / busy-looping - #29549

Closed
robobun wants to merge 33 commits into
mainfrom
farm/ed4a7fa6/fix-abortsignal-timeout-tla-hang
Closed

Exit unsettled top-level await instead of hanging / busy-looping#29549
robobun wants to merge 33 commits into
mainfrom
farm/ed4a7fa6/fix-abortsignal-timeout-tla-hang

comment: refer to the local `promise` by name, not line number

93e2313
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed May 5, 2026 in 32m 39s

Code review found 1 potential issue

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

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/jsc/event_loop.zig:683-700 beforeExit handler resolving abandoned TLA drops continuation (sibling to test 6)

Annotations

Check warning on line 700 in src/jsc/event_loop.zig

See this annotation in the file changed.

@claude claude / Claude Code Review

beforeExit handler resolving abandoned TLA drops continuation (sibling to test 6)

nit: this PR makes a new state reachable — `waitForPromiseOrLoopExit` returns with the module promise still `.pending`, control flows to `vm.onBeforeExit()` (bun.js.zig:531), and a `process.on('beforeExit', …)` handler that synchronously resolves the awaited promise has its continuation dropped (same "user JS resolves the TLA → microtask invisible to liveness check" gap that the drain-then-recheck here and test 6 fix for `unhandledRejection`, but one frame later in `onBeforeExit()`). Not a block