forked from lix-project/lix
Relock wait for build slot goals
When we don’t have enough free job slots to run a goal, we put it in the waitForBuildSlot list & unlock its output locks. This will continue from where we left off (tryLocalBuild). However, we need the locks to get reacquired when/if the goal ever restarts. So, we need to send it back through tryToBuild to get reqacquire those locks. I think this bug was introduced in https://github.com/NixOS/nix/pull/4570. It leads to some builds starting without proper locks.
This commit is contained in:
parent
d169eb2a1b
commit
9a14335845
|
@ -153,6 +153,7 @@ void LocalDerivationGoal::killChild()
|
||||||
void LocalDerivationGoal::tryLocalBuild() {
|
void LocalDerivationGoal::tryLocalBuild() {
|
||||||
unsigned int curBuilds = worker.getNrLocalBuilds();
|
unsigned int curBuilds = worker.getNrLocalBuilds();
|
||||||
if (curBuilds >= settings.maxBuildJobs) {
|
if (curBuilds >= settings.maxBuildJobs) {
|
||||||
|
state = &DerivationGoal::tryToBuild;
|
||||||
worker.waitForBuildSlot(shared_from_this());
|
worker.waitForBuildSlot(shared_from_this());
|
||||||
outputLocks.unlock();
|
outputLocks.unlock();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue