Skip to content

Timer objects no longer show up in process._getActiveHandles() #25806

Closed
@isaacs

Description

@isaacs

Up until node v10, process._getActiveHandles() would show Timer objects that were keeping the process open.

For example:

$ node -v
v10.15.1

$ node -p 'setTimeout(_=>_,500);process._getActiveHandles().filter(h=>h!=process.stdout && h !=process.stderr)'
[ Timer {
    _list:
     TimersList {
       _idleNext: [Timeout],
       _idlePrev: [Timeout],
       _unrefed: false,
       msecs: 500,
       _timer: [Circular] } } ]

However, in Node v11, this is not the case:

$ node -v
v11.8.0

$ node -p 'setTimeout(_=>_,500);process._getActiveHandles().filter(h=>h!=process.stdout && h !=process.stderr)'
[]

Is there a better or more canonical way to get insight into what's keeping the process from exiting gracefully? Or is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    timersIssues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.wontfixIssues that will not be fixed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions