Uh oh!
There was an error while loading. Please reload this page.
fix false positives when probing local ports already used - #32
Open
solsson wants to merge 1 commit into
Open
Conversation
checkHostPort bound 127.0.0.1 and reported every failure as "host
port N in use (likely another cluster)". Two distinct conflations
came out of that, each of which blocked ystack's docker acceptance
run on a cluster whose ports were entirely free.
A refused bind is not a taken port. Ports under 1024 need privilege,
which the probe does not have, so a non-root provision of ystack's
`{host: "80", guest: "80"}` forward failed preflight on a host where
`docker run -p 80:80` publishes fine. Split EADDRINUSE from EACCES
and let the caller say who does the binding: under PortBinderDaemon
(docker) a refused probe is evidence of nothing, since dockerd or
Docker Desktop's root helper does the bind; under PortBinderSelf
(qemu, which binds hostfwd in-process as the invoking user) it is a
real blocker, now reported as a privilege problem rather than as a
phantom second cluster. Where the probe can't answer, a connect
probe asks the weaker question any user may ask.
The probe address was wrong too. Both providers bind the wildcard --
docker's HostIP is 0.0.0.0, qemu's `hostfwd=tcp::<port>-` leaves the
host address empty -- and Go sets SO_REUSEADDR on every listener, so
on BSD a loopback probe binds happily beside a wildcard listener that
already owns the port. A host-local `y-cluster serve` on *:8944 thus
passed preflight and took the provision down with the daemon's own
"address already in use". Probe 0.0.0.0, plus loopback for the
mirror-image case where a 127.0.0.1 listener leaves the provider's
bind intact but steals the traffic the cluster is reached on.
The two platforms disagree in ways the tests now pin down. Darwin
skips the reserved-port check for INADDR_ANY only, so any user binds
0.0.0.0:80 while 127.0.0.1:80 is refused; Linux enforces the
restriction on every address. The privileged-port tests skip where
the environment cannot produce EACCES and run on Linux CI.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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 freeto 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.
for in-docker provisioner