This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
child_process: do not keep list of sent sockets
Keeping list of all sockets that were sent to child process causes memory leak and thus unacceptable (see #4587). However `server.close()` should still work properly. This commit introduces two options: * child.send(socket, { track: true }) - will send socket and track its status. You should use it when you want to receive `close` event on sent sockets. * child.send(socket) - will send socket without tracking it status. This performs much better, because of smaller number of RTT between master and child. With both of these options `server.close()` will wait for all sent sockets to get closed.
- Loading branch information
Showing
7 changed files
with
463 additions
and
99 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
4488a69
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
child.send(message, [sendHandle], [options])
where is the [options] param?
i can't find it in lib/child_process.js
thx
4488a69
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xianbei This commit never really made it into a stable branch, it got superseded by something else.