Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--v8-pool-size=0 does not shut down when process is complete #41135

Closed
wjaspers opened this issue Dec 10, 2021 · 3 comments
Closed

--v8-pool-size=0 does not shut down when process is complete #41135

wjaspers opened this issue Dec 10, 2021 · 3 comments
Labels
v8 engine Issues and PRs related to the V8 dependency.

Comments

@wjaspers
Copy link

wjaspers commented Dec 10, 2021

Version

v14.17.4

Platform

Linux OMITTED 5.13.0-22-generic #22-Ubuntu SMP Fri Nov 5 13:21:36 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

test file

# test.js
const events = require('events');
const EventEmitter = events.EventEmitter;
const TEARDOWN = 'teardown';

const applicationEvents = new EventEmitter();

function onTeardown(listener) {
    return applicationEvents.on(TEARDOWN, listener);
}

function emitTeardown() {
    return applicationEvents.emit(TEARDOWN);
}

onTeardown(() => (console.log('Goodbye!')));
Promise.resolve().then(emitTeardown);

call (failing)

node --v8-pool-size=0 ./test.js

call (passing)

# note 1 or higher is fine
node --v8-pool-size=1 ./test.js

call (passing)

# note, no v8 switch
node ./test.js

How often does it reproduce? Is there a required condition?

  • Always: Start with the --v8-pool-size=0 switch
  • Never: Omit the --v8-pool-size switch
  • Never: set the --v8-pool-size switch to any positive number

What is the expected behavior?

The process exits cleanly, presumably 0.

What do you see instead?

The process never ends.

Additional information

an strace reveals the last action after console output

futex(0x4565f60, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY
@Mesteery Mesteery added the v8 engine Issues and PRs related to the V8 dependency. label Dec 14, 2021
@yashLadha
Copy link
Contributor

Checked with the current master seems to be working fine. Following is the output that i see when running the test script.

❯ ./node --v8-pool-size=0 ./test.js
Goodbye!

@daeyeon
Copy link
Member

daeyeon commented Mar 30, 2022

I observed a similar issue (#42523) when running a script using worker_threads.

@targos targos added the v14.x label Nov 8, 2022
@targos
Copy link
Member

targos commented Nov 8, 2022

Closing, as only Node.js 14 is affected and this is a non-critical issue for which we haven't identified the fix.

@targos targos closed this as completed Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

No branches or pull requests

5 participants