daemon: Unregister build hook from the worker's children upon build failure.

Fixes <https://bugs.gnu.org/38062>.
This is a followup to ada9a19a2d.

* nix/libstore/build.cc (DerivationGoal::killChild): Add conditional
call to 'worker.childTerminated' for 'hook->pid'.
This commit is contained in:
Ludovic Courtès 2019-11-04 22:49:49 +01:00
parent 32793c09ff
commit af73beeba1
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 5 additions and 0 deletions

View File

@ -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();
}