Repository navigation
fix(registration): probe the bind port separately from the advertised port - #42
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
Author
|
@claude review |
Merged
mortenoh
added a commit
that referenced
this pull request
Sep 30, 2026
Bump version 2.0.2 -> 2.0.3 and refresh the lockfile. Patch release probing the local bind port for registration readiness separately from the advertised port (#42).
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 CLIM-1248: a service whose advertised port (
SERVICEKIT_PORT) differs from the port it binds, for example a container run with-p 18701:8000and registering with an orchestrator on the Docker host, never passed the readiness gate and skipped registration, because the gate probed127.0.0.1:<SERVICEKIT_PORT>.Changes
with_registration(local_port=...)if set (exclusively), otherwisePORT(orlocal_port_env), the advertised port, and 8000 are tried in turn. Existing setups where the advertised port equals the bind port keep working.x-servicekit-readiness-tokenand echoed back by a small ASGI middleware installed outside auth, so another server on a candidate port (such as an orchestrator on 8000) is never mistaken for the service, and auth-protected apps still pass.run_appnow exports the port uvicorn binds asPORT, alongside the existingSERVICEKIT_PORTdefault.SERVICEKIT_PORTis the port as seen from the orchestrator (container port on a shared Docker network, published host port when the orchestrator runs on the host); documentedlocal_port/local_port_env.Verification
make lintandmake testpass (513 passed, 5 skipped); new tests cover port candidates, token matching, a decoy server on a candidate port, and the CLIM-1248 scenario.uvicorn svc:app --port 8000andSERVICEKIT_PORT=18701: the probe finds the app on 8000 and it registers ashost.docker.internal:18701. With the orchestrator itself answering/healthon 8000, it is ignored.No breaking change to the public API; the renamed helpers (
_resolve_port,_wait_until_ready) are private.