Skip to content

fix(python): report bound server port - #12906

Closed
promiseeuler wants to merge 1 commit into
rerun-io:mainfrom
promiseeuler:fix/python-server-bound-port
Closed

fix(python): report bound server port#12906
promiseeuler wants to merge 1 commit into
rerun-io:mainfrom
promiseeuler:fix/python-server-bound-port

Conversation

@promiseeuler

Copy link
Copy Markdown

Related

What

While using rerun-sdk==0.35.0, I found that rr.server.Server(host="127.0.0.1", port=0) binds an OS-assigned ephemeral port but returns rerun+http://127.0.0.1:0, which clients cannot use.

This change builds the Python server URL after startup from ServerHandle::connect_addr(), so it reports the actual bound port while preserving the existing connectable-host behavior for unspecified bind addresses. It also adds a regression test that verifies the reported port is nonzero and accepts a TCP connection.

Confidence: high. The Python binding was constructing the URL from the requested address before the server started; the server handle already exposes the resolved connect address after binding.

Validation:

  • pixi run py-build
  • pixi run py-fmt
  • pixi run lint-rerun rerun_py/src/server.rs rerun_py/tests/unit/test_server.py
  • rustup run stable rustfmt --edition 2024 --check rerun_py/src/server.rs
  • pixi run uv run pytest -q rerun_py/tests/unit/test_server.py -k "port_zero_reports_bound_port or random_port" — 2 passed
  • git diff --check

The complete test_server.py run reached 12 passing tests and 3 dataset-fixture failures because this shallow checkout contains Git LFS pointer files instead of the RRD fixtures (the loader reads vers rather than an RRF2 header).

Disclosure

I used an LLM-assisted workflow for this contribution. I manually reproduced the released behavior, reviewed the binding and server-handle paths, implemented the fix, and ran the validation listed above.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for opening this pull request.

Because this is your first time contributing to this repository, make sure you've read our Contributor Guide and Code of Conduct.

@Wumpf
Wumpf requested a review from emilk August 26, 2026 12:38
@mailmindlin mailmindlin closed this Sep 3, 2026
rerun-sync Bot pushed a commit that referenced this pull request Sep 3, 2026
### Related
* Closes #12905
* Closes #12906

Source-Ref: 45ebdf76279a89cb84957270d6e0cc653956791e
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

Python Server(port=0) reports an unusable port-zero URL

1 participant