Closed
Description
Version
v18.0.0-pre
What steps will reproduce the bug?
// Flags: --v8-pool-size=0
const { Worker, isMainThread } = require('worker_threads');
if (isMainThread) {
console.log('[main thread]');
const worker = new Worker(__filename);
worker.on('exit', (exitCode) => { console.log('worker exited with', exitCode); });
process.on('exit', (exitCode) => { console.log('main thread exited with', exitCode); });
} else {
console.log('[worker]');
}
Run a file including the above script with --v8-pool-size=0
cli option.
How often does it reproduce? Is there a required condition?
I guess it always occurs when running any script using worker_threads with --v8-pool-size=0
.
What is the expected behavior?
[main thread]
[worker]
worker exited with 0
main thread exited with 0
What do you see instead?
[main thread]
[worker]