Skip to content

fix(node): settle the expand promise when its thread cannot start - #64

Merged
seatedro merged 1 commit into
masterfrom
rohit/diff-core-node-expand-settle
Nov 3, 2026
Merged

seatedro merged 1 commit into
masterfrom
rohit/diff-core-node-expand-settle

Conversation

@seatedro

@seatedro seatedro commented Nov 3, 2026

Copy link
Copy Markdown
Owner

If expand couldn't start its thread, its promise never settled and kept Node's event loop alive, because the unsettled deferred was dropped inside the failed spawn's closure. The deferred is now handed over a channel once the thread exists, as diff's queue already does, and rejected with the spawn error otherwise.

expand moved its deferred into the thread's closure, so a failed spawn
dropped it unsettled. JsDeferred has no Drop, and its thread-safe
function stays referenced, so the promise leaked and kept Node's event
loop alive; the caller got a thrown error and a promise that never
settles.

Hand the deferred over a channel once the thread exists, as the diff
queue does, and reject it with the spawn error otherwise.
@seatedro seatedro closed this Nov 3, 2026
@seatedro seatedro reopened this Nov 3, 2026
@seatedro
seatedro enabled auto-merge November 3, 2026 12:43
@seatedro
seatedro merged commit 71621b3 into master Nov 3, 2026
14 of 15 checks passed
@seatedro
seatedro deleted the rohit/diff-core-node-expand-settle branch November 3, 2026 12:54
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