This repository was archived by the owner on Apr 22, 2023. It is now read-only.
Add IPC disconnect method when using fork #2591
Closed
AndreasMadsen wants to merge 2 commits intonodejs:masterfrom
Closed
Add IPC disconnect method when using fork #2591AndreasMadsen wants to merge 2 commits intonodejs:masterfrom
AndreasMadsen wants to merge 2 commits intonodejs:masterfrom
Conversation
doc/api/child_processes.markdown
Outdated
Member
|
lgtm! @piscisaureus can you please put your word here? |
This disconnect method allow the child to die graceful unlike .kill() there would send a signal and stop the event loop. This also adds a disconnect event and connect property.
Member
Author
|
@indutny I have made a correction 3e42012, after your final review. Described in commit. |
There could be cases where a data chunk would contain a linebreak sign followed by an unfinched message. This would result in .buffering to be false. To fix this we detect if length of the JSONbuffer is zero.
Member
Author
|
@indutny Yup, old habit, fixed :) |
Member
Author
|
@piscisaureus could you review this, it blocks my cluster work pretty badly. |
|
Landed in 836344c. Thanks Andreas. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@indutny
This add a
disconnectmethod to thechildobject (in parent) and in theprocessobject (in child), when using.fork. It allow the child to self terminate since there is no IPC keeping it alive:It allow the following issues to be fixed:
Please note that is related to #2426, I will update that one when this has landed, but it just made sense to split #2426 up in two pull requests.
This also solves some future issues related to cluster 2.0 (see #2038)