-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
child_process: tracking unrefdness of child_process #5827
Conversation
- initializing `_unref` to `false` when child process is created - updating that value each time either `unref()` or `ref()` is invoked - this mirrors the implementation in `lib/net.js` - adding test to check unrefdness tracking
LGTM, but the tests would be a little more readable, IMO, if you used |
hmm.. how would this be used? If it's intended to be used by userland code, then the |
Been thinking about this sort of thing for a while, I think it would be best for every handle to have this sort of property in c++, accessible to JS, if possible. |
- using strictEqual in tests
@jasnell see this comment in the related PR. We probably should decide on one of those for a discussion thread since they are so similar. |
This allows third-party tools to check whether or not a handle that can be unreferenced is unreferenced at a particular time. Notably, this should be helpful for inspection via AsyncWrap. Also, this is useful even to node's internals, particularly timers. Refs: nodejs#5828 Refs: nodejs#5827 PR-URL: nodejs#5834 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Closing this for the same reasons as #5828. |
This allows third-party tools to check whether or not a handle that can be unreferenced is unreferenced at a particular time. Notably, this should be helpful for inspection via AsyncWrap. Also, this is useful even to node's internals, particularly timers. Refs: #5828 Refs: #5827 PR-URL: #5834 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Affected core subsystem
child_process
Description of change
_unref
tofalse
when child process is createdunref()
orref()
is invokedlib/net.js
R= @Fishrock123
R= @trevnorris