aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build/worker.cc
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2024-10-12 20:20:03 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2024-10-12 21:16:30 +0200
commita322fcea4a3630853bb1e91f411da5d37a8b4523 (patch)
treeb038f8f166ee90f407ce0a055a813435f0ebdcb1 /src/libstore/build/worker.cc
parent9865ebaaa618d82a7b7fdccc636cbaa7dfa42427 (diff)
worker: respect C-c on `sudo nix-build`
While debugging something else I observed that latest `main` ignores `Control-C` on `sudo nix-build`. After reading through the capnproto docs, it seems as if the promise must be fulfilled to actually terminate the `promise.wait()` below. This also applies to scenarios such as stopping the client (`nix-build`), but the builders on the daemon-side are still running, i.e. closes #540 Co-authored-by: eldritch horrors <pennae@lix.systems> Change-Id: I9634d14df4909fc1b65d05654aad0309bcca8a0a
Diffstat (limited to 'src/libstore/build/worker.cc')
-rw-r--r--src/libstore/build/worker.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstore/build/worker.cc b/src/libstore/build/worker.cc
index d1c1abdf8..10f58f5d3 100644
--- a/src/libstore/build/worker.cc
+++ b/src/libstore/build/worker.cc
@@ -239,7 +239,7 @@ Worker::Results Worker::run(std::function<Targets (GoalFactory &)> req)
auto onInterrupt = kj::newPromiseAndCrossThreadFulfiller<Result<Results>>();
auto interruptCallback = createInterruptCallback([&] {
- return result::failure(std::make_exception_ptr(makeInterrupted()));
+ onInterrupt.fulfiller->fulfill(result::failure(std::make_exception_ptr(makeInterrupted())));
});
auto promise = runImpl(std::move(topGoals))