worker_threads isolate executor#3
Merged
Merged
Conversation
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.
adds runInWorker, a stronger tier under the same verified-run contract that runs untrusted source in a worker_threads isolate instead of an in-process vm context. the worker gets its own V8 heap and thread, starts with an empty process.env and frozen globals, and takes an optional heap cap that comes back as an out-of-memory result. the nice part is it closes the in-process gap we pinned last time: the constructor walk that reaches the host realm now only reaches the worker realm, which has no host credentials, and there's an escape-attempt test that puts a secret in process.env and shows the sandbox still can't see it. the deadline hard-kills the thread so a sync spin and a never-settling promise are both handled, not just abandoned. one tradeoff worth knowing, grant values and return values cross by structured clone so you pass data, not live functions, for now.