Repository navigation
fix: every stop followed by a start holds the daemon, not only a restart - #491
Merged
Merged
Conversation
A candidate of a service without a proxy takes over by a stop and a start (`take_over`), from the watcher, with no request holding the daemon: when the idle check ran in the gap, the daemon ended and the start ran in a daemon on its way out (`an_edit_while_exited_follows_the_restart`, Windows CI, twice). #481 guarded `restart` alone; `switching` is now the one guard, used by restart, take-over, relaunch and the hot-reload switch. Bug-Class: race-on-idle Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7schmiede
force-pushed
the
fix/idle-across-every-switch
branch
from
November 9, 2026 14:33
fb38e9b to
5f2fbcd
Compare
Merged
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.
What and why
an_edit_while_exited_follows_the_restartfailed on Windows CI twice (in #485 and #486, whose diffs touch onlyci.ymlandCargo.lock). The daemon log shows a real bug, not a flaky test: a candidate of a service without a proxy took over by a stop and a start; 9 ms after the stop the idle check found nothing running (daemon_idle_end, "nothing runs in it any more"), and the start ran in a daemon on its way out. The test's next request was refused.restart()registered itself; a candidate taking over in place (take_over, from the watcher, with no request holding the daemon),relaunchand the hot-reload switch stop and start without it.race-on-idle(sibling of #481)daemon_idle_endbetween the candidate's stop and start). Unit testa_switch_under_way_counts_as_runningfor the guard (nested, dropped); locally on Windowsan_edit_while_exited_follows_the_restart,restart_on_a_folder_…,a_failed_first_start_…green. The race itself is not reproducible on demand (a 1 s tick against a gap of milliseconds).stop+startpairs in the daemon: restart (guarded), take-over, relaunch, hot reload: now one guard,switching. A lane's reset and a group's start/stop come as requests, which hold the daemon already.Supervisor::switching, an RAII guard: one place every stop-then-start goes through.No review card: a fix within ADR-0095's rule.
🤖 Generated with Claude Code