Skip to content

Commit 0c25bea

Browse files
edolstramergify[bot]
authored andcommitted
Respect max-substitution-jobs again
This broke in #11005. Any number of PathSubstitutionGoals would be woken up by a single build slot becoming available. If there are a lot of substitution goals active, this could lead to us running out of file descriptors (especially on macOS where the default limit is 256). (cherry picked from commit a33cb8a)
1 parent 9d8669b commit 0c25bea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstore/build/substitution-goal.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Goal::Co PathSubstitutionGoal::tryToRun(StorePath subPath, nix::ref<Store> sub,
183183
/* Make sure that we are allowed to start a substitution. Note that even
184184
if maxSubstitutionJobs == 0, we still allow a substituter to run. This
185185
prevents infinite waiting. */
186-
if (worker.getNrSubstitutions() >= std::max(1U, (unsigned int) settings.maxSubstitutionJobs)) {
186+
while (worker.getNrSubstitutions() >= std::max(1U, (unsigned int) settings.maxSubstitutionJobs)) {
187187
worker.waitForBuildSlot(shared_from_this());
188188
co_await Suspend{};
189189
}

0 commit comments

Comments
 (0)