Repository navigation
feat(serve): bind port 0 and announce the port the system chose - #1062
Merged
Merged
Conversation
The start-up smoke test picked a free port, released it and started serve on it; another process could take it in between. serve now accepts port 0 and prints the address it listens on, and the test reads that. Refs #992 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yeongseon
approved these changes
Oct 6, 2026
yeongseon
left a comment
Collaborator
There was a problem hiding this comment.
diff 를 읽고 승인합니다. #1057 에서 "막지 않음" 으로 남긴 포트 경합이 이것으로 없어집니다.
port == 0일 때만 한 줄을 더 찍으므로 다른 포트의 출력과 동작은 그대로입니다. 그 줄은 소켓이 바인드·listen 된 뒤에 찍히므로, 줄을 읽은 쪽이 바로 연결해도serve_forever전의 연결은 backlog 에서 기다립니다.- 테스트의 읽기 스레드가 포트를 찾은 뒤에도 stdout 을 계속 비우므로,
serve가 로그를 많이 써도 파이프가 차서 멈추지 않습니다. - 줄이 안 나오거나 프로세스가 먼저 끝나면 그때까지의 출력을 붙여 실패합니다.
serving … :0 줄이 그대로인 것은 본문대로 알아 둡니다.
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.
무엇을
#1057 리뷰에서 "막지 않음"으로 남기신 것 — 스모크 테스트가 포트를 잡았다 놓고 다시 여는 사이의 경합 — 을 없앱니다.
serve --port 0: 운영체제가 포트를 고르고,serve가listening on http://<host>:<port>를 한 줄 출력합니다. 다른 포트 값의 동작과 출력은 그대로입니다.tests/unit/test_oidc_start_smoke.py: 미리 포트를 고르지 않고--port 0으로 띄운 뒤 그 줄에서 포트를 읽습니다. 60초 안에 그 줄이 없거나 프로세스가 먼저 끝나면 그때까지의 출력을 붙여 실패합니다.알아 둘 것
--port 0일 때 CLI 가 먼저 찍는serving kpubdata-builder on http://…:0줄은 그대로:0입니다. 실제 포트는 그 다음 줄에 나옵니다. 그 줄까지 바꾸려면 바인드를 CLI 쪽으로 옮겨야 해서 손대지 않았습니다.검증
ruff,mypy src통과Refs #992
🤖 Generated with Claude Code