fix(runner-controller): count a finished VM as spent, not idle #591

Sammanfogat
supernaut sammanfogade 1 incheckning från fix/runner-idle-spent-vm in i main 2026-10-08 15:10:43 +00:00
Ägare

Closes #566.

A one-job runner VM stays ACTIVE until Nova reports SHUTOFF. Its job has already left "running", so _compute_capacity counted it as idle and booted nothing for a queued job. Waits of 120 to 190 s happened below the cap.

Change

  • _count_spent_vms counts ACTIVE VMs whose Forgejo registration is gone. The controller registers the runner before boot, so a missing registration means the VM is spent.
  • _compute_capacity takes spent_count and leaves spent VMs out of idle capacity.
  • A failed runners read counts nothing as spent. A read error can only under-boot.

Tests

The three journal cases from #566 plus four edge cases. test_controller_logic.py: 77/77.

Closes #566. A one-job runner VM stays ACTIVE until Nova reports SHUTOFF. Its job has already left "running", so `_compute_capacity` counted it as idle and booted nothing for a queued job. Waits of 120 to 190 s happened below the cap. ## Change - `_count_spent_vms` counts ACTIVE VMs whose Forgejo registration is gone. The controller registers the runner before boot, so a missing registration means the VM is spent. - `_compute_capacity` takes `spent_count` and leaves spent VMs out of idle capacity. - A failed runners read counts nothing as spent. A read error can only under-boot. ## Tests The three journal cases from #566 plus four edge cases. `test_controller_logic.py`: 77/77.
supernaut lade till 1 incheckning 2026-10-08 15:08:20 +00:00
fix(runner-controller): count a finished VM as spent, not idle (#566)
Alla kontroller lyckades
ci / ci (pull_request) Successful in 1m45s
ca2a4d96cb
A one-job VM stays ACTIVE until Nova reports SHUTOFF. Its job has left
"running", so _compute_capacity counted it as idle and booted nothing
while a job waited.

Count VMs whose Forgejo registration is gone as spent and leave them out
of idle capacity. A failed runners read counts nothing spent, so an
error can only under-boot.
supernaut schemalade den här ändringsförfrågan för automatisk sammanfogning när alla kontroller lyckas 2026-10-08 15:09:54 +00:00
supernaut sammanfogade incheckning 875e4213b1 till main 2026-10-08 15:10:43 +00:00
supernaut tog bort grenen fix/runner-idle-spent-vm 2026-10-08 15:10:43 +00:00
Logga in för att delta i denna konversation.
Inga granskare
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-infra!591
Ingen beskrivning angiven.