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

Timer handles not reported in Node 11 #213

Closed
BenoitZugmeyer opened this issue Nov 26, 2018 · 1 comment
Closed

Timer handles not reported in Node 11 #213

BenoitZugmeyer opened this issue Nov 26, 2018 · 1 comment

Comments

@BenoitZugmeyer
Copy link

Since Node 11, timers (created by setTimeout, setInterval...) are not reported by process._getActiveHandles(), so they don't appear in dump().handles

To reproduce

$ cat test.js
const eventLoopInspector = require('event-loop-inspector')

setTimeout(() => {}, 500)
console.log(process.version);
console.log('Dump handle names:', Object.keys(eventLoopInspector().dump().handles))
console.log('Active handles count:', process._getActiveHandles().length)

$ ~/.nvm/versions/node/v10.13.0/bin/node test.js
v10.13.0
Dump handle names: [ 'setTimeout' ]
Active handles count: 3

$ node test.js
v11.2.0
Dump handle names: []
Active handles count: 2

Regression details

Impacting Node PR: nodejs/node#20894

git bisect log
# bad: [cea049bcf8bb0f9a6e0095dbd5dffdb14dc8f71b] 2018-10-23, Version 11.0.0 (Current)
# good: [d1af1e4e59f6656428d57e685750f049e7830634] buffer: removed unneeded FastBuffer constructor
git bisect start 'v11.0.0' 'd1af1e4e59'
# bad: [d0a545ca3807928e80bb48eb6a7037dd13bebcb3] deps: cherry-pick 907d7bc from upstream V8
git bisect bad d0a545ca3807928e80bb48eb6a7037dd13bebcb3
# good: [1c1b8ae409368adee82ebe4edc090db570d21764] lib: support ranges in validateInt32()
git bisect good 1c1b8ae409368adee82ebe4edc090db570d21764
# good: [9310f86cb306a66a0473722471abd1f2a747132c] test: removing unnecessary parameter from assert call
git bisect good 9310f86cb306a66a0473722471abd1f2a747132c
# bad: [484c6c31b068fb64fa8b4bd46b82bc09a54a6a17] doc: fix some typos in N-API docs
git bisect bad 484c6c31b068fb64fa8b4bd46b82bc09a54a6a17
# good: [6ced651b6c3da64727bce260ecf55b8d86ec6cc3] build: add crypto check to markdown lint target
git bisect good 6ced651b6c3da64727bce260ecf55b8d86ec6cc3
# bad: [65f617314d1ea2df8b9e16fb7e7078b5913c749c] src: start annotating native code side effect
git bisect bad 65f617314d1ea2df8b9e16fb7e7078b5913c749c
# good: [1e7ff81e47bed3275728eee1a676ba95e4f2b41d] doc: update LICENSE file
git bisect good 1e7ff81e47bed3275728eee1a676ba95e4f2b41d
# bad: [c7c52127ec993803f82e17d5631738c38fb1e1e0] doc: update AUTHORS list
git bisect bad c7c52127ec993803f82e17d5631738c38fb1e1e0
# bad: [15c627f185608951775f48a2e2d9b2cb2fe0ce3c] http2: track memory allocated by nghttp2
git bisect bad 15c627f185608951775f48a2e2d9b2cb2fe0ce3c
# bad: [2930bd1317d15d12738a4896c0a6c05700411b47] src: refactor timers to remove TimerWrap
git bisect bad 2930bd1317d15d12738a4896c0a6c05700411b47
# good: [6f63f8d730c8c3b19de7a591c35d376d428a4d56] test: remove outdated, non-functioning test
git bisect good 6f63f8d730c8c3b19de7a591c35d376d428a4d56
# first bad commit: [2930bd1317d15d12738a4896c0a6c05700411b47] src: refactor timers to remove TimerWrap

Downstream impact

This implies a major downstream issue:

  • pm2-server-monit uses timers to periodically fetch various metrics from the operating system, and registers custom actions to be triggered by the user

  • pm2-io-apm monitors active handles to make sure to remove the message listener when no handle exists anymore (here and here in the rewrite)

Since in this case only timer handles are created, pm2-io-apm directly removes the message listener and no actions can be triggered afterward.

@vmarchaud vmarchaud transferred this issue from keymetrics/event-loop-inspector Nov 26, 2018
@vmarchaud
Copy link
Contributor

Both should be working with the newest version (3.0.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants