On Fri, Jul 12, 2013 at 8:41 AM, Floby <[email protected]> wrote:

> It was exaclty the question you asked. It you were only ready to accept a
> answer from Isaac, then you should have mailed him.
>

I'm sorry but it really wasn't the question I asked. You told me why
cluster works the way it does in the general case for opening ports in
child processes, and that functionality makes total sense - but I was
asking specifically about when you do .listen(0) to get a randomly
generated free port.

A process might do that N times to get N listening ports, but under the
current implementation they get exactly 1, meaning communication crosses
over, and is thus not "private", this is a bug IMHO, but if people asked
for it maybe they have a reason that could be easily explained.

The most reasonable answer was from Ben - that people asked for it to
behave this way. But I'd love to hear from someone who relies on this
functionality, as frankly it is broken.

Take for example node-phantom (which I've "fixed" now by re-writing it to
launch the random port in phantom itself, which doesn't have this bug, but
that's beside the point). It cannot work properly under cluster because it
does .listen(0) to open a random free port, then passes that port to
communicate with a newly spawned phantom instance. As soon as you try to
launch the second instance of phantom it tries to communicate back over the
first opened socket, never generating a new socket. This causes things to
break badly.

Matt.

-- 
-- 
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to