This was exactly what I needed. The very last step of app shutdown I set a 5 second timer and unref() it, and print out _getActiveHandles in the handler. For a while I thought it wasn't giving me accurate results because it showed a timer that didn't make sense to me - one I had cancelled - but it turns out there is some strange behavior with unref()'d interval timers and it was showing me the problem timer. (Related to https://github.com/joyent/node/issues/7327, if you unref() an interval timer and cancel it after the first time it expires, it won't invoke the callback any more, but it holds the event loop alive until the next expiration time. So the cancellation only does half of what I'd expect. Simply not unref()'ing the interval timer solved my problem, since an non-unref()'d interval timer will "let go" of the event loop immediately.)
On Saturday, January 24, 2015 at 8:35:46 PM UTC-5, Ryan Graham wrote: > > It sounds like you are looking for process._getActiveHandles(). You could > set up a signal handler for SIGUSR2 or an unref()'d timer to log the output > of that function to the console. > > It's not always the easiest to decipher, but it should give you some ideas > of where to look. > > ~Ryan > > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/52acb085-cea5-430e-8e86-c329da60ac13%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
