Skip to content

fix(nos-runner): restart a slot whose runner waits too long for a job - #303

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

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

Conversation

@smartwatermelon-agent

Copy link
Copy Markdown
Contributor

A NOS runner slot whose JIT runner waits idle for hours goes stale and stops getting jobs (the 2026-11-20 hang lasted 51 h). The supervisor now restarts such a slot.

  • New pass step restart_stale_slots, called after deregister_pending. For a slot older than NOS_IDLE_MAX_S (default 3600 s; 0 disables) whose runner GitHub reports idle, it deletes the runner, then stops the VM. A failed or unreadable busy check counts as busy.
  • Delete before stop: GitHub answers a DELETE of a busy runner with 422, so a runner that took a job after the busy read keeps its VM. The one race left is a job assigned before GitHub reports the runner busy (accepted 2026-11-18).
  • At most one slot restarts per pass, so the pool never drops to zero online runners. A restart does not count as a failed start. A failed stop leaves the dropped-N marker for a later pass.
  • After a good stop, the VM list is refreshed, so an empty slot can start in the same pass.
  • Runbook: the new log line, and a note that a quiet night restarts each slot about hourly.

Tests: 11 new idle_restart_* cases in scripts/nos-runner/tests/test-supervisor.sh, including the 422 case. run-tests.sh passes, and shellcheck -S info is clean.

The live proof on MIMOLETTE follows after merge, and it closes the issue.

Advances #297

Claude Code Bot added 2 commits November 23, 2026 15:08
A JIT runner that waits idle for hours goes stale and stops getting
jobs. The supervisor now deletes the runner and restarts the slot once
it has waited NOS_IDLE_MAX_S (default 3600 s, 0 disables). It checks
that GitHub reports the runner idle, deletes before stopping so a busy
runner (HTTP 422) keeps its VM, and restarts one slot per pass.

Advances #297
After a good idle restart the cached container ls still listed the
stopped VM, so an empty slot in the same pass saw too many VMs and
waited a pass. Refresh the list as reconcile does. Also record the
remaining busy-assignment race in the comment.

Advances #297
@smartwatermelon-agent
smartwatermelon-agent Bot merged commit c8f7971 into main Nov 23, 2026
6 checks passed
@smartwatermelon-agent
smartwatermelon-agent Bot deleted the claude/fix-nos-idle-restart-56536f08 branch November 23, 2026 23:36
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