diff --git a/src/hydra-queue-runner/builder.cc b/src/hydra-queue-runner/builder.cc index eecf43c4..42ebfa66 100644 --- a/src/hydra-queue-runner/builder.cc +++ b/src/hydra-queue-runner/builder.cc @@ -28,6 +28,7 @@ void State::builder(MachineReservation::ptr reservation) { auto activeStep = std::make_shared(); + auto machineSshName = reservation->machine->sshName; activeStep->step = reservation->step; activeSteps_.lock()->insert(activeStep); @@ -39,9 +40,12 @@ void State::builder(MachineReservation::ptr reservation) auto destStore = getDestStore(); res = doBuildStep(destStore, reservation, activeStep); } catch (std::exception & e) { + if (!reservation) { + printMsg(lvlError, "machine '%s' has been released unexpectedly", machineSshName); + } printMsg(lvlError, "uncaught exception building ā€˜%sā€™ on ā€˜%sā€™: %s", - localStore->printStorePath(reservation->step->drvPath), - reservation->machine->sshName, + localStore->printStorePath(activeStep->step->drvPath), + machineSshName, e.what()); } }