joyent/node — pull request #4368 by ronkorving (2012-12-05 11:49:02+00:00)
Title: When listen() fails, cluster breaksCluster close fix

In lib/cluster.js, net._createServerHandle() is incorrectly assumed to succeed. When it doesn't (on the first listen attempt in the cluster), the null-handler still gets registered in the serverHandlers map, causing subsequent listen() attempts to fail as well. Also, when calling cluster.disconnect(), it will now attempt to call null.close().

The PR I sent probably deals with this in an incomplete way, but this is as far as my understanding has taken me at this time. Please review it, and let me know where it may need improvement.