Sign in

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

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Stop a superseded build instead of leaving it to finish

3031e35772b7d5498c3cb1427424169889632ab5 · Keenan Nemetz · 11d ago · parent 3ae0f579

Stop a superseded build instead of leaving it to finish

A push that replaced a branch tip canceled the older commit's queued runs but
left a running one alone. With long jobs and a single-slot runner, the runner
kept building a commit that was no longer on the branch while the new tip's
jobs waited. A rewrite can leave that commit unreachable entirely: on rack's
seam-joint branch the old tip ran for 27m38s after the branch had moved, with
12 jobs queued behind it.

CancelSuperseded now asks a running run for the replaced commit to stop too:
it sets cancel_requested and leaves the lease, which is the path a manual
cancel already uses. The runner stops at its next heartbeat, RecordAttempt
keeps the result canceled rather than failed, and RequeueExpired already
cancels a requested stop whose runner vanished instead of making it leasable
again.

The stale-deploy test moves its second commit with a fetch instead of a push:
a push now stops the running build, and the deploy guard is what covers the
window before the runner sees the request. It then pushes a third commit so
the fresh-build half of the test still runs.

Verified with go test ./server/ and vole workflow run verify.

docs/runner.md +2−2

@@ -322,8 +322,8 @@ slots, active work, and queued jobs.
322 322 - Run records live in `data/runs.db`, not the repository's metadata branch.
323 323 - A push normally queues work immediately; a 30-second reconciliation compares
324 324 refs with queued tips to recover missed notifications.
325 - A replacement push cancels queued runs for the old commit but does not stop an
326 active run.
325 - A replacement push cancels queued runs for the old commit and asks an active
326 run to stop at its next heartbeat.
327 327 - `vole run cancel <id>` asks the runner to stop at its next heartbeat and records
328 328 who requested cancellation.
329 329 - A lost lease is requeued. After five attempts, the run fails instead of cycling.