From 90a08db241951f818f19ffd1cb79f8bc0b5c636c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 22 Jun 2015 10:59:07 +0200 Subject: [PATCH] hydra-queue-runner: Fix assertion failure --- src/hydra-queue-runner/hydra-queue-runner.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc index 3e55c868..c71d7691 100644 --- a/src/hydra-queue-runner/hydra-queue-runner.cc +++ b/src/hydra-queue-runner/hydra-queue-runner.cc @@ -863,8 +863,8 @@ void State::dispatcher() do { /* Copy the currentJobs field of each machine. This is - necessary to ensure that the sort comparator below is a - ordering. std::sort() can segfault if it isn't. */ + necessary to ensure that the sort comparator below is + an ordering. std::sort() can segfault if it isn't. */ struct MachineInfo { Machine::ptr machine; @@ -1203,7 +1203,10 @@ bool State::doBuildStep(std::shared_ptr store, Step::ptr step, { auto rdep_(rdep->state.lock()); rdep_->deps.erase(step); - if (rdep_->deps.empty()) runnable = true; + /* Note: if the step has not finished + initialisation yet, it will be made runnable in + createStep(), if appropriate. */ + if (rdep_->deps.empty() && rdep->created) runnable = true; } if (runnable) makeRunnable(rdep);