Repository navigation
fix(daemon): keep the daemon port out of OS ephemeral ranges and bind loopback (#1700) - #1728
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 27 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
zackees
force-pushed
the
fix/1700-daemon-port-window
branch
from
October 25, 2026 04:45
89a994c to
1434230
Compare
… loopback (#1700) On Linux the default daemon window (49152-65535) overlapped the kernel's ephemeral range (32768-60999), so an unrelated outgoing connection could hold the daemon's port; the 0.0.0.0 bind then failed with EADDRINUSE while nothing listened, and startup burned its spawn budget retrying. Non-Windows daemons now take 10000-32767, below the Linux and macOS ephemeral ranges, and bind 127.0.0.1 instead of 0.0.0.0 (every client connects to loopback). Adds a Linux repro of the wildcard-vs-loopback collision and a test against the host's live ip_local_port_range.
zackees
force-pushed
the
fix/1700-daemon-port-window
branch
from
October 25, 2026 04:57
1434230 to
21f3b13
Compare
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.
Fixes #1700.
Cause
ip_local_port_range, 32768–60999 by default. About 74% of possible daemon ports could therefore be taken by any unrelated outgoing connection on a busy CI runner.0.0.0.0:Pbind failed with EADDRINUSE while nothing was listening. The retry loop then used up the CLI's 3×10 s spawn budget (daemon did not become healthy after 3 spawn attempts).Change
127.0.0.1instead of0.0.0.0.127.0.0.1, and nothing in the repo reaches the daemon from off-box.FBUILD_DAEMON_PORToverride still works.Verification
crates/fbuild-core/src/platform/linux/ipc.rs). An outgoing socket bound to127.0.0.2:Pand connected to a local server makes a wildcard listener onPfail, while127.0.0.1:Pbinds. This is the mechanism from the issue.crates/fbuild-paths/src/lib.rs). It reads the host's liveip_local_port_rangeand asserts the default daemon port is outside it. Onmainthis checkout's port was 52817, inside 32768–60999, so the test fails there and passes here. The existing range tests were updated to the new window.-D warningsis clean, and thefbuild-daemon,fbuild-pathsandfbuild-clitests pass.fbuild build tests/platform/uno -e unosucceeded, with the daemon onLISTEN 127.0.0.1:11393.Not covered