Commit 5ffa892991

5ffa892991a5437dc53680ea1609fabee4b85d42

parent: 65f453dc9b

Verified · cmc ci/build: success ci/test: success

cmc <hello@cleberg.net> · 2026-09-07 06:52 UTC

deploy, wiki: KillMode=mixed so a stop reaches only the runner

The drain in 65f453d never protected a build on bay1: the unit's default
control-group kill mode sends SIGTERM to every process in the cgroup, so
the ssh log session and the build's container died in the same instant
the runner began draining. mixed signals the main process alone and
kills what remains once it has exited.

Ref #179

Layout: unified · split

.gitbay/wiki/Admin.org +4 −1
@@ -478,7 +478,10 @@ run with =-isolation none=, set it back to =yes=.
478478
479479*Restarting the runner is safe.* On SIGTERM it stops claiming, finishes
480480the build in flight, reports it, and exits; the drop-in's
481=TimeoutStopSec=50min= covers the longest build. So =make deploy-runner=
481=TimeoutStopSec=50min= covers the longest build, and its =KillMode=mixed=
482is what makes the signal reach the runner alone — under systemd's default
483the build's container and the log session are signalled with it, and the
484runner drains a build that is already dead. So =make deploy-runner=
482485waits for a running build rather than orphaning it, and a build's result
483486is retried for half a minute if gitbayd is restarting at that moment. A
484487second SIGTERM ends the runner at once, abandoning the build to the
deploy/gitbay-runner.override.conf +7
@@ -49,6 +49,13 @@ ExecStopPost=-/usr/bin/pkill -u ci-runner -x catatonit
4949# is 45m plus half a minute of report retries — before systemd kills it.
5050# `make deploy-runner` therefore waits for a running build (#179).
5151TimeoutStopSec=50min
52# The drain only works if the stop signal reaches the runner alone. The
53# default control-group mode sends SIGTERM to every process in the
54# cgroup at once — the ssh session streaming the log and the build's
55# container with it — so the runner drained a build whose steps were
56# already dead. mixed signals the main process only; whatever is left
57# when it exits is killed.
58KillMode=mixed
5259ExecStart=
5360ExecStart=/usr/local/bin/gitbay-runner -remote git@127.0.0.1 -workdir /var/lib/gitbay-runner/work -poll 5s -timeout 45m -repos krz/gitbay,cmc/ci-smoke -isolation podman -image localhost/gitbay-ci:1 -cpus 3
5461Nice=10