From af73beeba1fc9effab60b11aea1d7ed8c24e7367 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 4 Nov 2019 22:49:49 +0100 Subject: daemon: Unregister build hook from the worker's children upon build failure. Fixes . This is a followup to ada9a19a2dca74feafcf24df1152abd685d4142f. * nix/libstore/build.cc (DerivationGoal::killChild): Add conditional call to 'worker.childTerminated' for 'hook->pid'. --- nix/libstore/build.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'nix') diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index 74cd05417f..c4fc87746a 100644 --- a/nix/libstore/build.cc +++ b/nix/libstore/build.cc @@ -947,6 +947,11 @@ void DerivationGoal::killChild() assert(pid == -1); } + /* If there was a build hook involved, remove it from the worker's + children. */ + if (hook && hook->pid != -1) { + worker.childTerminated(hook->pid); + } hook.reset(); } -- cgit v1.2.3