hydra-queue-runner: Handle exceptions in the dispatcher thread
E.g. "resource unavailable" when creating new threads.
This commit is contained in:
parent
7863d2e1da
commit
de9d7bcf25
|
@ -32,6 +32,8 @@ void State::makeRunnable(Step::ptr step)
|
|||
void State::dispatcher()
|
||||
{
|
||||
while (true) {
|
||||
|
||||
try {
|
||||
printMsg(lvlDebug, "dispatcher woken up");
|
||||
nrDispatcherWakeups++;
|
||||
|
||||
|
@ -54,6 +56,12 @@ void State::dispatcher()
|
|||
}
|
||||
*dispatcherWakeup_ = false;
|
||||
}
|
||||
|
||||
} catch (std::exception & e) {
|
||||
printMsg(lvlError, format("dispatcher: %1%") % e.what());
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
printMsg(lvlError, "dispatcher exits");
|
||||
|
|
Loading…
Reference in a new issue