-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
Description of Bug
When creating a node.js worker with infinite loop, the main thread cannot terminate the worker.
Steps to Reproduce
Run the following code in stackblitz:
const { Worker } = require("node:worker_threads")
console.log("main start")
const worker = new Worker(`
console.log("worker start")
while (true) {}
`, {eval:true});
setTimeout(() => worker.terminate(), 1000)Expected Behavior
The process should exit as in real machine.