hydra-queue-runner: --build-one: correctly handle a cached build

Previously, the build ID would never flow through channels which
exited.

This patch tracks the buildOne state as part of State and exits avoids
waiting forever for new work.

The code around buildOnly is a bit rough, making this a bit weird to
implement but since it is only used for testing the value of improving
it on its own is a bit questionable.
This commit is contained in:
Graham Christensen
2021-03-16 16:09:36 -04:00
parent 930f05c38e
commit 87d46ad5d6
4 changed files with 22 additions and 14 deletions

View File

@ -367,6 +367,7 @@ private:
/* Specific build to do for --build-one (testing only). */
BuildID buildOne;
bool buildOneDone = false;
/* Statistics per machine type for the Hydra auto-scaler. */
struct MachineType
@ -485,8 +486,7 @@ private:
BuildID buildId,
const RemoteResult & result,
Machine::ptr machine,
bool & stepFinished,
bool & quit);
bool & stepFinished);
Jobset::ptr createJobset(pqxx::work & txn,
const std::string & projectName, const std::string & jobsetName);