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

Ability to introspect the event loop #14704

Closed
strugee opened this issue Aug 8, 2017 · 3 comments
Closed

Ability to introspect the event loop #14704

strugee opened this issue Aug 8, 2017 · 3 comments
Labels
feature request Issues that request new features to be added to Node.js. question Issues that look for answers.

Comments

@strugee
Copy link
Contributor

strugee commented Aug 8, 2017

(Leaving out the issue template as this is a feature request - hopefully this is okay; CONTRIBUTING.md doesn't really specify.)

I'm the maintainer for pump.io, a server written in Node.js. I'm working on a feature to implement zero-downtime restarts which involves gracefully shutting down and then respawning cluster processes. Basically the way this works is that the master process uses worker.send to signal the worker to call server.close() on the HTTP server(s), and then everything else in the process is shut down after that completes.

However, there's still stuff keeping the process open - AFAICT some listener must still be on the event loop. It would be really awesome if I had a way to say, "just dump stack traces of everything you're watching for on the event loop" so I could track down where these listeners are being registered in the first place. (Or maybe I'm going about this all wrong? If so feel free to say so.)

@mscdex mscdex added feature request Issues that request new features to be added to Node.js. question Issues that look for answers. labels Aug 9, 2017
@strugee
Copy link
Contributor Author

strugee commented Aug 9, 2017

For anyone stumbling on this issue in the future, https://www.npmjs.com/package/wtfnode is apparently a thing. It is not a Good Thing:tm:, however, because private methods.

@Trott
Copy link
Member

Trott commented Aug 9, 2017

Hi @strugee!

Check out #1128 for a previous discussion.

I think this is now possible to accomplish with the experimental async-hooks.

@bnoordhuis
Copy link
Member

Answered, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

4 participants