mirror of
https://github.com/NixOS/hydra.git
synced 2024-10-18 17:02:28 -04:00
hydra-evaluator: Set jobset error if hydra-eval-jobset dies
This commit is contained in:
parent
4576b3d35b
commit
e2a012de8c
|
@ -232,6 +232,24 @@ struct Evaluator
|
||||||
if (jobset.second.pid == pid) {
|
if (jobset.second.pid == pid) {
|
||||||
printInfo("evaluation of jobset ‘%s:%s’ %s",
|
printInfo("evaluation of jobset ‘%s:%s’ %s",
|
||||||
jobset.first.first, jobset.first.second, statusToString(status));
|
jobset.first.first, jobset.first.second, statusToString(status));
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
if (!WIFEXITED(status) || WEXITSTATUS(status) > 1) {
|
||||||
|
auto conn(dbPool.get());
|
||||||
|
pqxx::work txn(*conn);
|
||||||
|
txn.parameterized
|
||||||
|
("update Jobsets set errorMsg = $1, errorTime = $2")
|
||||||
|
(fmt("evaluation %s", statusToString(status)))
|
||||||
|
(time(0))
|
||||||
|
.exec();
|
||||||
|
txn.commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (std::exception & e) {
|
||||||
|
printError("exception setting jobset error: %s", e.what());
|
||||||
|
}
|
||||||
|
|
||||||
jobset.second.pid.release();
|
jobset.second.pid.release();
|
||||||
maybeDoWork.notify_one();
|
maybeDoWork.notify_one();
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue