Skip to content

Log why the server stopped before removing its marker - #6

Merged
barath-dev merged 1 commit into
mainfrom
fix-stop-log-order
Nov 23, 2026
Merged

barath-dev merged 1 commit into
mainfrom
fix-stop-log-order

Conversation

@barath-dev

Copy link
Copy Markdown
Owner

CI on main failed on Ubuntu after #5 was merged (run 45140844082): server_stops_itself_when_no_page_is_open found no "no page open" in ui.log.

Cause: a race. When it stops, the server removed ui.pid and only then wrote "paddock stopped (no page open)" to its log. The test waits for ui.pid to go and reads the log straight away, so a fast reader could land between the two. It passed in #5's own run on the same code; it was already there before #5.

Fix: write the log line first, then remove the marker, so once ui.pid is gone the log already says why the server stopped. A restart still says "starting the new version", in the same new order.

Checked: clippy clean; all tests pass; the idle test 10 times in a row.

🤖 Generated with Claude Code

https://claude.ai/code/session_013DS9XhJVN73JGnZEqrX89o

The server removed ui.pid, then wrote "paddock stopped (...)" to its log.
Whatever waits for ui.pid to go could read the log in between: the idle
test did on Ubuntu CI (server_stops_itself_when_no_page_is_open, after
the merge of #5), and found no "no page open" yet. The line is now written
first, so once the marker is gone the log already says why.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013DS9XhJVN73JGnZEqrX89o
@barath-dev
barath-dev merged commit 83768d5 into main Nov 23, 2026
6 checks passed
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.

1 participant