Skip to content

Run worker threads with --v8-pool-size=0 #42523

Closed
@daeyeon

Description

@daeyeon

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    workerIssues and PRs related to Worker support.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions