Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Stop a runner by draining instead of killing its jobs

f642e0aa232df7a284b9d9026fe17b34eada634c · Keenan Nemetz · 2d ago · parent 77056ba8

Stop a runner by draining instead of killing its jobs

SIGTERM ended the process mid-step, so a build that was nearly done was thrown
away and its run sat unclaimed until the lease expired. With --jobs that is N jobs
instead of one.

A runner now stops taking work on a signal and lets the jobs it already has finish
and report. The one wait it cannot interrupt from inside is a parked lease — the
reply is read by the session's decoder, and nothing else can break that read — so
the session is hung up from outside its lock and the slot exits. That costs
nothing: a slot parked on a lease is holding no job. A second signal ends the
process at once, which is what signal.Stop restores.

The packaged unit allows 60 seconds for the drain (TimeoutStopSec), so a longer
build is still killed; docs/runner.md and docs/deploy/runner.md say how to raise it
and why.

Refs: 01M6SCWCSX39QXS38QAHQSMVGX (#216)

docs/runner.md +16

@@ -71,6 +71,22 @@ expires — and the slot reconnects rather than stopping the rest.
71 71 With `--once`, `--jobs 4` starts up to four jobs, finishes them, and exits, which is
72 72 the shape a scheduler that starts a container per job wants.
73 73
74 ## Stopping a runner
75
76 A runner that is asked to stop — `systemctl stop`, Ctrl-C, a `SIGTERM` — stops
77 taking work and lets the jobs it already has finish and report. That is the
78 difference between a build that is nearly done being published and being thrown
79 away, and it means the run is not left unclaimed until its lease expires. A second
80 signal ends the process at once.
81
82 Under systemd the packaged unit allows 60 seconds for that
83 (`TimeoutStopSec`), so a job that runs longer than that is killed anyway. If builds
84 on a machine take longer and you would rather wait for them, raise it:
85
86 ```sh
87 sudo systemctl edit vole-runner # [Service] / TimeoutStopSec=30min
88 ```
89
74 90 ## The runner's account
75 91
76 92 A runner connects as an account, and that account is the runner's identity: it is