fc-queue-runner: implement per-build cancellation via CancellationToken
Adds an `ActiveBuild` registry (DashMap of `<Uuid, CancellationToken>`) to `WorkerPool` and get `dispatch()` to create a per-build token to race `run_build` against it via Tokio's `select!`. The `cancel_checker_loop` then polls the DB every N seconds (currently 2) for builds cancelled while running, and triggers their tokens. Existing `kill_on_drop(true) on `nix build` processes handles subprocess cleanup when the future is dropped. Thank you past me for your insight. Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ic8af58e92972c7d5d104d9c717e9217d6a6a6964
This commit is contained in:
parent
d401177902
commit
f8586a7f3c
4 changed files with 82 additions and 21 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -874,6 +874,7 @@ dependencies = [
|
|||
"chrono",
|
||||
"clap",
|
||||
"config",
|
||||
"dashmap",
|
||||
"fc-common",
|
||||
"serde",
|
||||
"serde_json",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue