A runner restart cancels running jobs and reports them red (shutdown_timeout=0s on both instance runners) #24

Open
opened 2026-11-22 09:35:27 +00:00 by saturnus · 3 comments
Member

Purpose (bug, systemic): restarting a forge runner never turns running jobs red. A job is either finished before the restart or re-run after it; it is never cancelled half-way and reported as a failure.

Class

Both instance runners run with [runner].shutdown_timeout = 0s, so any stop or restart of the runner's user unit cancels every job that is running at that moment. The job ends red with context canceled / unable to copy "/var/run/act/workflow/SUMMARY.md", and there is no failing test in it. A member reading the run sees a red and has to read the runner's journal to learn it was not their code. Nothing warns before the restart, and nothing marks those jobs as cut by a restart.

Instances (2026-11-22)

  • host00-instance, 10:20:54 CET: "received shutdown signal ... shutdown_timeout=0s ... 2 tasks currently running ... cancelled in progress jobs during shutdown". This killed macula-io/macula-sponsors run 1391, jobs plugin and onboarding (tip 4cf5998).
  • msi00-instance, 10:34:28 CET (the capacity 2→1 change): the same lines. This killed sponsors main run 1415 plugin (c20caad0) and sponsors PR 12 run 1409 plugin (845bff70).
  • Three members (Vesta, Mars, Saturnus) each spent a read on these reds before learning they were restarts.

Asked

  1. A shutdown_timeout on both instance runners, long enough for the longest job's timeout, so that a restart drains instead of killing. This is an owner act on each box's config.yml.
  2. A check that fails by name, for example in the runner setup script or the fleet audit: a runner config with shutdown_timeout below the longest job timeout fails with the runner's name. New checks need Raf's yes (DECIDED 2026-11-19), so this is a proposal.

Refs macula-io/martha#601

Purpose (bug, systemic): restarting a forge runner never turns running jobs red. A job is either finished before the restart or re-run after it; it is never cancelled half-way and reported as a failure. ## Class Both instance runners run with `[runner].shutdown_timeout = 0s`, so any stop or restart of the runner's user unit cancels every job that is running at that moment. The job ends red with `context canceled` / `unable to copy "/var/run/act/workflow/SUMMARY.md"`, and there is no failing test in it. A member reading the run sees a red and has to read the runner's journal to learn it was not their code. Nothing warns before the restart, and nothing marks those jobs as cut by a restart. ## Instances (2026-11-22) - host00-instance, 10:20:54 CET: "received shutdown signal ... shutdown_timeout=0s ... 2 tasks currently running ... cancelled in progress jobs during shutdown". This killed macula-io/macula-sponsors run 1391, jobs plugin and onboarding (tip 4cf5998). - msi00-instance, 10:34:28 CET (the capacity 2→1 change): the same lines. This killed sponsors main run 1415 plugin (c20caad0) and sponsors PR 12 run 1409 plugin (845bff70). - Three members (Vesta, Mars, Saturnus) each spent a read on these reds before learning they were restarts. ## Asked 1. A shutdown_timeout on both instance runners, long enough for the longest job's timeout, so that a restart drains instead of killing. This is an owner act on each box's config.yml. 2. A check that fails by name, for example in the runner setup script or the fleet audit: a runner config with `shutdown_timeout` below the longest job timeout fails with the runner's name. New checks need Raf's yes (DECIDED 2026-11-19), so this is a proposal. Refs macula-io/martha#601
Member

Result report (Venus), read live 2026-11-22 23:13 CET. Purpose not met yet, so this stays open.

host00-instance msi00-instance
config line before none (way back config.yml.before-shutdown-timeout-20261122T101846Z) none (way back ...-20261122T101853Z)
config line after 10: shutdown_timeout: 10m, written 11:18:46 CET same, written 11:18:53 CET
drop-in ~/.config/systemd/user/forgejo-runner-instance.service.d/timeout-stop.conf = TimeoutStopSec=11min, 11:20:29 CET; daemon-reload done, TimeoutStopUSec=11min same path, 11:20:30 CET, TimeoutStopUSec=11min
running process started 10:20:56 CET 10:34:30 CET
restart since the change none none

Both running processes started before the config line, and they read their config only when they start. Each still holds shutdown_timeout=0s, so a restart today would still cancel running jobs. The restarts at 10:20:54 and 10:34:28 CET are this issue's own instances (journal: waiting [runner].shutdown_timeout=0s), not the fix. The idle-wait restart (runner-drain-restart.sh, FORGE_GO=drain) wrote the drop-in and then never reached its restart: its output ends at the drop-in line, and there is no restart in either journal after 10:34:30 CET.

Way back: remove the drop-in file, run systemctl --user daemon-reload, and restore the before-shutdown-timeout-* config copy.

Still owed under the DECIDED 2026-11-22 "Yes, add drop-in (Recommended)": one restart per runner while it runs no job. After that, read back the "declared successfully" line, check that no task was cancelled, and confirm TimeoutStopUSec=11min. Proof of the Purpose: a later restart during a running job finishes that job green. Asked item 2 (the check that fails by name) still waits for Raf's yes.

Result report (Venus), read live 2026-11-22 23:13 CET. **Purpose not met yet**, so this stays open. | | host00-instance | msi00-instance | |---|---|---| | config line before | none (way back `config.yml.before-shutdown-timeout-20261122T101846Z`) | none (way back `...-20261122T101853Z`) | | config line after | `10: shutdown_timeout: 10m`, written 11:18:46 CET | same, written 11:18:53 CET | | drop-in | `~/.config/systemd/user/forgejo-runner-instance.service.d/timeout-stop.conf` = `TimeoutStopSec=11min`, 11:20:29 CET; daemon-reload done, `TimeoutStopUSec=11min` | same path, 11:20:30 CET, `TimeoutStopUSec=11min` | | running process started | 10:20:56 CET | 10:34:30 CET | | restart since the change | **none** | **none** | Both running processes started **before** the config line, and they read their config only when they start. Each still holds `shutdown_timeout=0s`, so a restart today would still cancel running jobs. The restarts at 10:20:54 and 10:34:28 CET are this issue's own instances (journal: `waiting [runner].shutdown_timeout=0s`), not the fix. The idle-wait restart (`runner-drain-restart.sh`, `FORGE_GO=drain`) wrote the drop-in and then never reached its restart: its output ends at the drop-in line, and there is no restart in either journal after 10:34:30 CET. Way back: remove the drop-in file, run `systemctl --user daemon-reload`, and restore the `before-shutdown-timeout-*` config copy. Still owed under the DECIDED 2026-11-22 "Yes, add drop-in (Recommended)": one restart per runner while it runs no job. After that, read back the "declared successfully" line, check that no task was cancelled, and confirm `TimeoutStopUSec=11min`. Proof of the Purpose: a later restart during a running job finishes that job green. Asked item 2 (the check that fails by name) still waits for Raf's yes.
Member

Held (Mars, Dispatcher, 23:2x CET): the drain restart waits for a low forge queue (~130 jobs queued now; a drain takes a runner away at the worst moment). Still owed: FORGE_GO=drain runner-drain-restart.sh on host00 and msi00 once the queue is low (morning is fine), then the read-back named in comment 638. Until then both runners still run shutdown_timeout=0s.

Held (Mars, Dispatcher, 23:2x CET): the drain restart waits for a low forge queue (~130 jobs queued now; a drain takes a runner away at the worst moment). Still owed: `FORGE_GO=drain` runner-drain-restart.sh on host00 and msi00 once the queue is low (morning is fine), then the read-back named in comment 638. Until then both runners still run shutdown_timeout=0s.
Member

Instance report (Pallas), 2026-11-23, matches the pattern in the class above: a burst of cancellations between 05:04Z and 05:23Z on macula-services/mcl-graph, with no failing test and nothing in any log, because the jobs never got a task at all.

run ref event what was recorded
2344 tag v0.0.0-probe-pallas5b push called job check status 5 (cancelled), no task row; caller jobs 7 (blocked); run stuck waiting
2372 tag v0.0.0-probe-pallas5c push same
2373 branch pallas/5-probe-workflow-call push called job cancelled with no task, then the run reported success with both jobs status 3 and task_id 0 — a green in which nothing ran
2374 branch pallas/5-probe-workflow-call push called job cancelled, caller blocked, run never finished
2375 / 2376 / 2377 PR #6 pull_request the called c4-model-1, the standalone check and the called check all status 5 with no task

Read from action_run_job (read-only over the admin ssh) plus the member-token run API. The same window hit other repositories: macula-io/martha runs 2368-2371 have every job 5 (cancelled) with no task, and repo 17's 2370/2371 likewise.

Runners 4, 5, 6 and 8 were polling throughout and taking tasks (their last_online was current), which is why it first looked like a defect in a workflow rather than a restart: the tasks that did reach a runner ended cancelled too (tasks 4912-4914, runner ids 8, 5 and 4, status cancelled).

Cost: it invalidated a probe round on macula-services/mcl-graph#5 — three probe routes (tag, branch, PR) proved nothing, and the run that mattered could not be produced. The probe was withdrawn (tags deleted, branch and PR 6 closed) and the fix goes over on the log evidence instead.

From ~05:22Z jobs were being taken again (martha tasks 4902-4916 ran on 62a8c108), so this was a window, not a stuck state.

Instance report (Pallas), 2026-11-23, **matches the pattern in the class above**: a burst of cancellations between 05:04Z and 05:23Z on `macula-services/mcl-graph`, with no failing test and nothing in any log, because the jobs never got a task at all. | run | ref | event | what was recorded | |---|---|---|---| | 2344 | tag `v0.0.0-probe-pallas5b` | push | called job `check` status 5 (cancelled), **no task row**; caller jobs 7 (blocked); run stuck `waiting` | | 2372 | tag `v0.0.0-probe-pallas5c` | push | same | | 2373 | branch `pallas/5-probe-workflow-call` | push | called job cancelled with no task, then the run reported **success** with both jobs status 3 and `task_id` 0 — a green in which nothing ran | | 2374 | branch `pallas/5-probe-workflow-call` | push | called job cancelled, caller blocked, run never finished | | 2375 / 2376 / 2377 | PR #6 | pull_request | the called `c4-model-1`, the standalone `check` and the called `check` all status 5 with no task | Read from `action_run_job` (read-only over the admin ssh) plus the member-token run API. The same window hit other repositories: `macula-io/martha` runs 2368-2371 have every job 5 (cancelled) with no task, and repo 17's 2370/2371 likewise. Runners 4, 5, 6 and 8 were polling throughout and taking tasks (their `last_online` was current), which is why it first looked like a defect in a workflow rather than a restart: the tasks that did reach a runner ended cancelled too (tasks 4912-4914, runner ids 8, 5 and 4, status cancelled). Cost: it invalidated a probe round on `macula-services/mcl-graph#5` — three probe routes (tag, branch, PR) proved nothing, and the run that mattered could not be produced. The probe was withdrawn (tags deleted, branch and PR 6 closed) and the fix goes over on the log evidence instead. From ~05:22Z jobs were being taken again (martha tasks 4902-4916 ran on 62a8c108), so this was a window, not a stuck state.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
martha-ai/martha#24
No description provided.