diff --git a/STATUS.md b/STATUS.md index bebbd61..7fb7d7f 100644 --- a/STATUS.md +++ b/STATUS.md @@ -2,6 +2,21 @@ Updated 2026-11-15. Architectural acceptance is separate from implementation. +## A stop takes effect immediately, not after two minutes (2026-11-15) + +`archipelago-release-cycle.service` was `Type=oneshot`. systemd does not deliver +SIGTERM to an activating oneshot; `systemctl stop` therefore sat in `stop-sigterm` +until `TimeoutStopSec=2min` expired and then SIGKILLed the coordinator. The portal +uses `--no-block`, so it answered 202 immediately while the run kept building, and +a manual stop looked ignored. Reproduced with a minimal `Type=oneshot` unit (SIGTERM +to the main process works, `systemctl stop` does not) and fixed by declaring the +driver what it is — a long-running job: `Type=exec`. A probe unit with the same +shape now stops in 25 ms and the coordinator writes its own `signal 15` failure and +worker-unit cleanup. `infrastructure/tests/control_portal.py` guards against +reverting to oneshot. Stopped run `20261115T194326Z` (started with the existing +`2026-11-12` snapshot by mistake) left state `failed`, 32 MiB of disposable worker +work and no stray mounts or transient units. + ## Manual builds pinned to an immutable snapshot, desktop Zen kernel (2026-11-15) The portal can now start a build itself and pin the repository it compiles from. diff --git a/deploy/archipelago-release-cycle.service b/deploy/archipelago-release-cycle.service index 6c2a462..4a5bae0 100644 --- a/deploy/archipelago-release-cycle.service +++ b/deploy/archipelago-release-cycle.service @@ -4,12 +4,14 @@ Wants=network-online.target After=network-online.target docker.service [Service] -Type=oneshot +# Type=exec, not oneshot: systemd does not deliver SIGTERM to an activating +# oneshot, so `systemctl stop` only took effect after TimeoutStopSec and the +# portal showed a run as unstoppable for two minutes. The driver is a long-running +# job; each of its worker actions is bounded to four hours by the driver itself. +Type=exec Environment="ARCHIPELAGO_RELEASE_REASON=Rust/manual release cycle (D-098)" ExecStart=/usr/bin/python3 /opt/archipelago/src/infrastructure/pipeline/release-cycle.py ExecStopPost=/usr/bin/python3 /opt/archipelago/src/infrastructure/pipeline/cycle-terminal.py -# Each worker action is bounded to four hours by the release driver. -TimeoutStartSec=infinity TimeoutStopSec=2min KillMode=control-group StandardOutput=journal diff --git a/tests/control_portal.py b/tests/control_portal.py index 6532512..845f7c5 100644 --- a/tests/control_portal.py +++ b/tests/control_portal.py @@ -120,6 +120,13 @@ class Portal(unittest.TestCase): with self.assertRaises(ValueError): app.snapshot_date('latest') + def test_release_unit_can_be_stopped_promptly(self): + # A long-running driver must not be a oneshot: systemd then refuses to + # deliver SIGTERM until TimeoutStopSec, so a stop looks ignored for minutes. + unit = (Path(__file__).parents[1] / 'deploy/archipelago-release-cycle.service').read_text() + self.assertIn('Type=exec', unit) + self.assertNotIn('Type=oneshot', unit) + def test_progress_markup_and_percentage_rules(self): root = Path(__file__).parents[1] / 'control' html = (root / 'index.html').read_text()