WIP: hydra-queue-runner: do not assume reservation is available when build step throws unexpectedly #1

Closed
raito wants to merge 1 commit from raito/hydra:rsv-nullpo into main

View file

@ -28,6 +28,9 @@ void State::builder(MachineReservation::ptr reservation)
{
auto activeStep = std::make_shared<ActiveStep>();
auto machineSshName = reservation->machine->sshName;
auto drvPath = reservation->step->drvPath;
activeStep->step = reservation->step;
activeSteps_.lock()->insert(activeStep);
@ -39,9 +42,12 @@ void State::builder(MachineReservation::ptr reservation)
auto destStore = getDestStore();
res = doBuildStep(destStore, reservation, activeStep);
} catch (std::exception & e) {
if (!reservation) {
printMsg(lvlTalkative, "machine '%s' has been released earlier (e.g. at copying outputs phase)", machineSshName);
}
printMsg(lvlError, "uncaught exception building %s on %s: %s",
localStore->printStorePath(reservation->step->drvPath),
reservation->machine->sshName,
localStore->printStorePath(drvPath),
machineSshName,
e.what());
}
}