hydra-queue-runner: Fix assertion failure

It was hitting

    assert(reservation.unique());

Since we do want the machine reservation to be released before calling
wakeDispatcher(), let's use a different object for keeping track of
active steps.
This commit is contained in:
Eelco Dolstra
2016-11-02 12:41:00 +01:00
parent 07decd6915
commit 4f08c85c69
2 changed files with 13 additions and 8 deletions

View File

@ -13,13 +13,14 @@ void State::builder(MachineReservation::ptr reservation)
nrStepsStarted++;
reservation->threadId = pthread_self();
activeSteps_.lock()->insert(reservation);
auto activeStep = std::make_shared<ActiveStep>();
activeStep->step = reservation->step;
activeStep->threadId = pthread_self();
activeSteps_.lock()->insert(activeStep);
Finally removeActiveStep([&]() {
reservation->threadId = -1;
activeSteps_.lock()->erase(reservation);
activeStep->threadId = -1;
activeSteps_.lock()->erase(activeStep);
});
auto step = reservation->step;