Commit 30e462e9 authored by Ben Noordhuis's avatar Ben Noordhuis
Browse files

cluster: propagate bind errors

This commit fixes a bug where the cluster module failed to propagate EADDRINUSE
errors.

When a worker starts a (net, http) server, it requests the listen socket from
its master who then creates and binds the socket.

Now, OS X and Windows don't always signal EADDRINUSE from bind() but instead
defer the error until a later syscall. libuv mimics this behaviour to provide
consistent behaviour across platforms but that means the worker could end up
with a socket that is not actually bound to the requested addresss.

That's why the worker now checks if the socket is bound, raising EADDRINUSE if
that's not the case.

Fixes #2721.
parent 83fd1c1d
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment