Fix promise transfer settlement stalling on node 26.4+ - #565
Merged
laverdet merged 1 commit intoAug 1, 2026
Merged
Conversation
TransferablePromiseHolder::ResolveTask settles the receiving side's promise without running a microtask checkpoint, so under the nodejs isolate's explicit microtasks policy the awaiting continuations stay queued until unrelated JS activity runs one. Node used to mask this with an accidental per-iteration checkpoint; nodejs/node#62969 (26.4.0) removed it.
skvelymake
pushed a commit
to integromat/isolated-vm
that referenced
this pull request
Aug 5, 2026
TransferablePromiseHolder::ResolveTask settles the receiving side's promise without running a microtask checkpoint, so under the nodejs isolate's explicit microtasks policy the awaiting continuations stay queued until unrelated JS activity runs one. Node used to mask this with an accidental per-iteration checkpoint; nodejs/node#62969 (26.4.0) removed it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a promise crosses isolates with
{ promise: true }, the other side receives its own promise which is settled later byTransferablePromiseHolder::ResolveTask. In the nodejs isolate, microtasks run under the explicit policy, so the settlement only queues theawaitcontinuations. No checkpoint runs afterwards, and they sit in the queue until some other JS callback triggers one. In a process that's just holding a server or an IPC channel, that's never.Why node 26.4
This stayed invisible because node used to run a checkpoint on every loop iteration, as a side effect of draining native immediates even when there was nothing to drain. nodejs/node#62969 (26.4.0) skips the empty drain, and the accidental checkpoint went with it.
Repro
Fix
The fix runs the checkpoint in
ResolveTask::Runonce the promise settles. Also adds a regression test, which fails on 26.4+ without the fix.