-
Notifications
You must be signed in to change notification settings - Fork 1
Log: Locally bound server address #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This includes the port that is selected if one tries to bind to port `0`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR improves debuggability by logging the actual bound server address instead of the requested address. This is particularly useful when using port 0 (ephemeral port assignment), where the OS assigns an available port at runtime.
Key Changes:
- Moved server address logging from application startup to after TCP listener binding
- Log now displays the actual bound address (e.g., "0.0.0.0:45953") rather than the requested address
- Added error handling for cases where the locally bound address cannot be retrieved
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| opsqueue/src/server.rs | Added logging of actual bound address using listener.local_addr() with error handling; also modified retry policy (unrelated change) |
| opsqueue/app/main.rs | Removed old logging statement that showed requested address instead of actual bound address |
| default.nix | Added "rust-src" extension to Rust toolchain (unrelated change) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ace9951 to
6eb18fe
Compare
|
@OpsBotPrime merge |
|
Rebased as 6eb18fe, waiting for CI … |
|
CI job 🟡 started. |
Changes: - Log the locally bound server address on startup, for easier debugging, especially when the port is randomly bound (PR #30 ) - Limit the maximum number of retries when starting Opsqueue and it failing to connect to a port. (PR #31 ) - Ensure `rust-src` is included in the `default.nix` shell, allowing the Rust language server to work without having to pull in the rust stdlib src outside of Nix. (PR #32)
Logging the actually bound port is good for debug-ability: