Skip to content

Conversation

@ReinierMaas
Copy link

@ReinierMaas ReinierMaas commented Dec 23, 2025

Logging the actually bound port is good for debug-ability:

$ target/debug/opsqueue --port 0
Starting Opsqueue v0.32.0
Hello, hello!
2025-12-23T14:33:12.068100Z  INFO ThreadId(01) opsqueue: 24: Finished setting up tracing subscriber
2025-12-23T14:33:12.069220Z  INFO ThreadId(01) opsqueue::db: 385: Starting up using existing sqlite DB opsqueue.db
2025-12-23T14:33:12.073634Z  INFO ThreadId(01) opsqueue::db: 390: Migrating backing DB
2025-12-23T14:33:12.073792Z  INFO ThreadId(01) opsqueue::db: 397: Finished migrating backing DB
2025-12-23T14:33:12.073817Z  INFO ThreadId(01) opsqueue: 66: Startup of Opsqueue (v0.32.0) complete.
2025-12-23T14:33:12.074275Z  INFO ThreadId(01) opsqueue::server: 48: Server listening on 0.0.0.0:45953
...

This includes the port that is selected if one tries to bind to port `0`.
@ReinierMaas ReinierMaas self-assigned this Dec 23, 2025
Copilot AI review requested due to automatic review settings December 23, 2025 14:35
Copy link

Copilot AI left a 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.

@ReinierMaas ReinierMaas force-pushed the reinier/log-bound-server-port branch from ace9951 to 6eb18fe Compare December 23, 2025 14:41
@ReinierMaas ReinierMaas changed the base branch from master to reinier/improve-devex December 23, 2025 14:42
@ReinierMaas ReinierMaas requested a review from Qqwy December 23, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants