cluster: respect server.listen() backlog parameter set by workers (credit: @oyyd)
Re-creating the closed pull request #33827 to fix #4056, a bug where the backlog
parameter passed in to server.listen(handle[, backlog][, callback])
from within a Node.js worker process isn't respected. Instead, the default value of 511
is always set and unable to be overriden.
More about the server.listen()
backlog
parameter:
All
listen()
methods can take abacklog
parameter to specify the maximum length of the queue of pending connections. The actual length will be determined by the OS through sysctl settings such astcp_max_syn_backlog
andsomaxconn
on Linux. The default value of this parameter is 511 (not 512).
This PR and all commits were authored by @oyyd. I've updated from nodejs/master
so it won't be behind any commits, and there were no conflicts.
The original PR was closed because a test was failing on Windows. I'd like the opportunity to fix that test. If you could please run Node.js Jenkins on the PR so I can look at the error log in case the test still fails, that would be greatly appreciated.
All thanks go to @oyyd for the original PR.
Checklist:
-
make -j4 test (UNIX), or vcbuild test (Windows) passes -
documentation is changed or added -
commit message follows commit guidelines