Repository navigation
Allow setting the listen backlog of server sockets - #3789
Open
sideeffffect wants to merge 4 commits into
Open
sideeffffect wants to merge 4 commits into
sideeffffect wants to merge 4 commits into
Conversation
Server sockets were bound with the platform default backlog (50 on the
JVM, 0 on Native, 511 on Node.js) and there was no way to change it.
Under bursts of new connections, the kernel's accept queue overflows and
each dropped SYN costs the client a 1-3 s retransmit.
Add a `SocketOption.backlog` pseudo-option. When passed to
`Network.bind` (and the APIs built on it), it is removed from the
options applied to accepted sockets and used as the backlog when the
server socket starts listening: `bind(address, backlog)` on the JVM
(IP and unix sockets), `listen(fd, backlog)` on Native, and
`server.listen({ backlog })` on Node.js. Without it, the platform
default is used as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sideeffffect
marked this pull request as ready for review
October 30, 2026 16:53
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enables setting the Backlog as a SocketOption. Before this, it was not configurable and users were at the mercy of the platform default (50 for OpenJDK).
SocketOption.backlog(n)requiresn > 0. When not set, each provider keeps its existing default: the JDK default (50) for JDK sockets, 128 for JNR unix sockets, 0 on Scala Native, and the Node.js default on JS.