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

merged merged by cmc on 2026-09-07 07:02 UTC · krz/gitbay:runner-killmode-179 into main

2 files changed, +11 −1

Layout: unified · split

.gitbay/wiki/Admin.org +4 −1
@@ -478,7 +478,10 @@ run with =-isolation none=, set it back to =yes=.
478 478
479*Restarting the runner is safe.* On SIGTERM it stops claiming, finishes 479*Restarting the runner is safe.* On SIGTERM it stops claiming, finishes
480the build in flight, reports it, and exits; the drop-in's 480the 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=
482waits for a running build rather than orphaning it, and a build's result 485waits for a running build rather than orphaning it, and a build's result
483is retried for half a minute if gitbayd is restarting at that moment. A 486is retried for half a minute if gitbayd is restarting at that moment. A
484second SIGTERM ends the runner at once, abandoning the build to the 487second 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
49# is 45m plus half a minute of report retries — before systemd kills it. 49# is 45m plus half a minute of report retries — before systemd kills it.
50# `make deploy-runner` therefore waits for a running build (#179). 50# `make deploy-runner` therefore waits for a running build (#179).
51TimeoutStopSec=50min 51TimeoutStopSec=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
52ExecStart= 59ExecStart=
53ExecStart=/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 60ExecStart=/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
54Nice=10 61Nice=10