fix(runner-controller): a finished VM counts as idle capacity until it shuts off #566

Stängd
öppnade 2026-10-08 13:48:39 +00:00 av supernaut · 0 kommentarer
Ägare

_compute_capacity counts a VM whose one job has finished as idle capacity.

forgejo-runner one-job exits and the VM powers off, but it stays ACTIVE until Nova reports SHUTOFF. In that window the job has left "running", so the controller sees an idle VM, boots nothing, and a queued job waits for the next reap.

Evidence from the controller journal, all below the cap:

  • 2026-10-03 19:42:25 active=2 (queued=2 + running=0) → create=0 until SHUTOFF at 19:43:55, pickup 120 s.
  • 2026-10-05 06:14:25 to 06:16:06 active=3 (queued=1 + running=2) → create=0, pickup 190 s.
  • 2026-10-05 08:07:16 active=4 (queued=3 + running=0) → create=0.

Raising max_total (#564) does not fix this.

Fix

Count a VM as idle only while its Forgejo runner registration is live and not busy. A registration that is gone means the VM is spent, whatever Nova says.

  • Change the idle count and cover the three cases above with a test.
`_compute_capacity` counts a VM whose one job has finished as idle capacity. `forgejo-runner one-job` exits and the VM powers off, but it stays ACTIVE until Nova reports SHUTOFF. In that window the job has left "running", so the controller sees an idle VM, boots nothing, and a queued job waits for the next reap. Evidence from the controller journal, all below the cap: - 2026-10-03 19:42:25 `active=2 (queued=2 + running=0) → create=0` until SHUTOFF at 19:43:55, pickup 120 s. - 2026-10-05 06:14:25 to 06:16:06 `active=3 (queued=1 + running=2) → create=0`, pickup 190 s. - 2026-10-05 08:07:16 `active=4 (queued=3 + running=0) → create=0`. Raising `max_total` (#564) does not fix this. ## Fix Count a VM as idle only while its Forgejo runner registration is live and not busy. A registration that is gone means the VM is spent, whatever Nova says. - [ ] Change the idle count and cover the three cases above with a test.
Logga in för att delta i denna konversation.
Ingen milstolpe
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#566
Ingen beskrivning angiven.