Skip to content

fix(nos-runner): never restart a slot while another slot is down - #306

Merged
smartwatermelon-agent[bot] merged 2 commits into
mainfrom
claude/fix-nos-idle-restart-both-56536f08
Nov 24, 2026
Merged

smartwatermelon-agent[bot] merged 2 commits into
mainfrom
claude/fix-nos-idle-restart-both-56536f08

Conversation

@smartwatermelon-agent

Copy link
Copy Markdown
Contributor

The idle restart from #303 restarted one slot per pass, but a restarted slot takes more than one pass to come back (its old runner must be deregistered first). On the first live run, slot 2 was stopped while slot 1 had no VM, so both slots were down at once:

15:40:08 slot 1: stopped mimolette-1-1795451966
15:40:41 slot 2: runner 732 idle for 25273 s (limit 3600 s); restarting
15:40:46 slot 2: stopped mimolette-2-1795451967
15:40:48 slot 1: started mimolette-1-1795477246 (runner 733)

The watchdog counts zero online runners as a miss. Both new VMs started 33 s apart, so this would repeat every idle hour.

  • restart_stale_slots now restarts a slot only if every other slot has a VM and a registered runner (name= and id= set, no dropped-N marker). With one slot there is no other slot to wait for, so the old behaviour stays.
  • A deferred restart is logged once per idle runner (deferred-N holds the runner id), not on every pass.
  • Tests: new idle_restart_waits_for_other_slot and idle_restart_deferral_logged_once. idle_restart_one_slot_per_pass now runs the extra passes slot 1 needs to come back. idle_restart_refreshes_vm_list checks that container ls runs again after the stop, because its old setup (the other slot empty) can no longer restart. A mutant with the refresh removed fails it.

run-tests.sh: 556 pass, 0 fail. shellcheck -S info is clean.

Known trade-off: if the other slot stays down without counting failures (for example, GitHub keeps returning 5xx for a JIT config), an idle runner is not restarted. The log says why.

Advances #297

Claude Code Bot added 2 commits November 23, 2026 16:18
The idle restart took one slot per pass, but a replacement can need
several passes to start. A second stale slot was then restarted while
the first had no VM, so both were offline and the watchdog saw a miss.

restart_stale_slots now restarts slot N only when every other slot has a
VM, a registered runner and no dropped marker.

Advances #297
A restart held back because another slot is down was silent. Log it once
per idle runner, tracked in deferred-N, and clear the marker on restart.
Also guard the refresh_ls test against an empty stop line.

Advances #297
@smartwatermelon-agent
smartwatermelon-agent Bot merged commit 76c7f33 into main Nov 24, 2026
6 checks passed
@smartwatermelon-agent
smartwatermelon-agent Bot deleted the claude/fix-nos-idle-restart-both-56536f08 branch November 24, 2026 00:35
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.

0 participants