From d265dd5993a9b6067bc20995946573e11c29573a Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Thu, 25 Jul 2024 18:05:42 +0200 Subject: [PATCH] libstore: count all substitutions toward the same limit limiting CA substitutions was a rather recent addition, and it used a dedicated counter to not interfere with regular substitutions. though this works fine it somewhat contradicts the documentation; job limits should apply to all kinds of substitutions, or be one limit for each. Change-Id: I1505105b14260ecc1784039b2cc4b7afcf9115c8 --- src/libstore/build/drv-output-substitution-goal.cc | 4 ++-- src/libstore/build/worker.hh | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libstore/build/drv-output-substitution-goal.cc b/src/libstore/build/drv-output-substitution-goal.cc index 5e83d769c..94c9206a3 100644 --- a/src/libstore/build/drv-output-substitution-goal.cc +++ b/src/libstore/build/drv-output-substitution-goal.cc @@ -41,13 +41,13 @@ void DrvOutputSubstitutionGoal::tryNext() /* Make sure that we are allowed to start a substitution. Note that even if maxSubstitutionJobs == 0, we still allow a substituter to run. This prevents infinite waiting. */ - if (worker.runningCASubstitutions >= std::max(1U, settings.maxSubstitutionJobs.get())) { + if (worker.runningSubstitutions >= std::max(1U, settings.maxSubstitutionJobs.get())) { worker.waitForBuildSlot(shared_from_this()); return; } maintainRunningSubstitutions = - std::make_unique>(worker.runningCASubstitutions); + std::make_unique>(worker.runningSubstitutions); if (subs.size() == 0) { /* None left. Terminate this goal and let someone else deal diff --git a/src/libstore/build/worker.hh b/src/libstore/build/worker.hh index eee47e23d..3984c9c1c 100644 --- a/src/libstore/build/worker.hh +++ b/src/libstore/build/worker.hh @@ -146,7 +146,6 @@ public: uint64_t doneSubstitutions = 0; uint64_t failedSubstitutions = 0; uint64_t runningSubstitutions = 0; - uint64_t runningCASubstitutions = 0; uint64_t expectedDownloadSize = 0; uint64_t doneDownloadSize = 0; uint64_t expectedNarSize = 0;