Skip to content

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

Closed
@wjaspers

Description

@wjaspers

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions