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

Feature Request: Event loop introspection #2527

Closed
fresheneesz opened this issue Aug 24, 2015 · 8 comments
Closed

Feature Request: Event loop introspection #2527

fresheneesz opened this issue Aug 24, 2015 · 8 comments
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. feature request Issues that request new features to be added to Node.js.

Comments

@fresheneesz
Copy link

Every once in a while I have a hanging process, and I have no idea why it hangs. It could take me hours to figure it out. It would be great if there were ways to ask the program things like:

  • How many open file descriptors are there? What kinds of things are they: (type [network, file system file, input descriptor], name ["http connection to <some IP address>"], etc)?
  • How many waiting timers are there? What callback(s) are associated with them (so you could print out the text of the functions)?

This would go a very long way in making hanging scripts easier to debug.

@Qard
Copy link
Member

Qard commented Aug 24, 2015

👍 I'd like to see this myself, at some point.

There's already process._getActiveHandles() and process._getActiveRequests() for that sort of thing. They're not currently part of the public API though, so they could change at any time. The necessary components to start on this are there though.

The timers one is a little harder, due to the weird batch processing of them. Still probably doable though.

@fresheneesz
Copy link
Author

Ah, those functions might come in useful at some point. Thanks!

@Fishrock123
Copy link
Contributor

There was definitely a previous issues about this, but I can't seem to find it... @Qard's answer is correct though.

@fresheneesz
Copy link
Author

@Fishrock123 Was it this: nodejs/node-v0.x-archive#1025 ?

@Fishrock123
Copy link
Contributor

@fresheneesz nope, there was one on this issue tracker.

@Qard
Copy link
Member

Qard commented Aug 24, 2015

You're thinking of #1128.

@thlorenz
Copy link
Contributor

active-handles handles (npi) part of these features and walks timers as well.

@Fishrock123
Copy link
Contributor

Ah yes. Closing in favor of #1128, please make any additional comments there! :)

@Fishrock123 Fishrock123 added duplicate Issues and PRs that are duplicates of other issues or PRs. feature request Issues that request new features to be added to Node.js. labels Aug 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. feature request Issues that request new features to be added to Node.js.
Projects
None yet
Development

No branches or pull requests

4 participants