feat(framework): Support port 0 for OS-assigned random unused port#6795
Merged
danieljanes merged 5 commits intomainfrom Mar 23, 2026
Merged
feat(framework): Support port 0 for OS-assigned random unused port#6795danieljanes merged 5 commits intomainfrom
0 for OS-assigned random unused port#6795danieljanes merged 5 commits intomainfrom
Conversation
0 for OS-assigned random unused port
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves gRPC server startup logging and test robustness by exposing and using the actual bound address (especially when binding to port 0 for dynamic port allocation) across SuperLink/SuperNode components.
Changes:
- Expose the bound address from
generic_create_grpc_serverviaserver.bound_addressand use it in startup logs. - Allow port
0in address parsing and skip port-availability checks for port0. - Update integration tests to bind on port
0and (where applicable) connect using the bound address.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| framework/py/flwr/common/grpc.py | Captures the actual bound port from gRPC and exposes it as server.bound_address. |
| framework/py/flwr/supercore/address.py | Allows port 0 in parsing and treats it as “no need to check availability”. |
| framework/py/flwr/supercore/address_test.py | Updates address parsing tests to treat port 0 as valid. |
| framework/py/flwr/server/app.py | Logs Fleet API startup using the server’s bound address. |
| framework/py/flwr/superlink/servicer/control/control_grpc.py | Logs Control API startup using the server’s bound address. |
| framework/py/flwr/server/superlink/serverappio/serverappio_grpc.py | Logs ServerAppIo API startup using the server’s bound address. |
| framework/py/flwr/server/superlink/simulation/simulationio_grpc.py | Logs SimulationIo API startup using the server’s bound address. |
| framework/py/flwr/supercore/grpc_health/health_server.py | Logs health server startup using the server’s bound address. |
| framework/py/flwr/supernode/start_client_internal.py | Logs ClientAppIo API startup using the server’s bound address. |
| framework/py/flwr/server/superlink/fleet/grpc_bidi/grpc_server_test.py | Uses port 0 for binding in integration tests (removes “unused port” helper). |
| framework/py/flwr/compat/client/grpc_client/connection_test.py | Uses port 0 for server binding and connects via the server’s bound address. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
panh99
commented
Mar 19, 2026
danieljanes
approved these changes
Mar 23, 2026
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.
Summary
bound_addressfromgeneric_create_grpc_server0and connect via the bound address