joyent/node — pull request #4595 by indutny (2013-01-14 20:00:33+00:00)
Title: child_process: do not keep list of sent sockets

Keeping list of all sockets that was sent to child process causes memory
leak and thus unacceptable (see #4587). However `server.close()` should
still work properly.

This commit is introducing two options:

* child.send(socket) - will send socket and track it's status. You
should use it when you want `server.connections` to be a reliable
number.
* child.send(socket, { track: false }) - will send socket without
tracking it status. This performs much better, because of smaller
number of RTT between master and child. But `server.connections` is
unreliable and will constantly grow.

With both of this options `server.close()` will wait for all sent
sockets to get closed.

/cc @isaacs @bnoordhuis @piscisaureus @AndreasMadsen