Oh and yes, you are absolutely on the right track. NODE_CHANNEL_FD signals that the stein is an IPC Pipe and that is handled in src/ node.js cluster.js simply uses child_process.js to establish children. net.js is where the funky listening port sharing stuff happens.
The cop pie wrapping is the actual means by which the child_process stuff manages the IPC. The actual problem with shutting down clusters is that although you close all listening sockets in a child the IPC pipe does not get closed. Also the listening sockets are still open in the parent. So your clustered node processes will never shut down properly, which in turn leads to an issue when you want to restart a cluster (such as after an update) since pretty much everything remains open. And you can't just kill the processes, since it would be possible that they should still be alive sice they are still handling an ongoing request. Regards, Phil On Feb 12, 10:36 pm, Mark Volkmann <r.mark.volkm...@gmail.com> wrote: > I'm trying to learn how the cluster module allows multiple TCP-based > servers to share a port. As far as I can tell, this isn't handled in > lib/cluster.js or lib/child_process.js. Perhaps it is handled in > src/node.js and is related to the environment variable access with > process.env.NODE_CHANNEL_FD. Am I on the right track? It's still a mystery > to me what is going on here. > > How are requests distributed among the workers? In my testing it seems that > the worker that handled the previous request will always handle the next > request as long as it finished processing the previous request. > > -- > R. Mark Volkmann > Object Computing, Inc. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: 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 post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en