forked from lix-project/hydra
exit with error if database connectivity lost
There's currently no automatic recovery for disconnected databases in the evaluator. This means if the database is ever temporarily unavailable, hydra-evaluator will sit and spin with no work accomplished. If this condition is caught, the daemon will exit and systemd will be responsible for resuming the service.
This commit is contained in:
parent
312cb42275
commit
70ad3a924a
|
@ -366,6 +366,9 @@ struct Evaluator
|
||||||
printInfo("received jobset event");
|
printInfo("received jobset event");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} catch (pqxx::broken_connection & e) {
|
||||||
|
printError("Database connection broken: %s", e.what());
|
||||||
|
std::_Exit(1);
|
||||||
} catch (std::exception & e) {
|
} catch (std::exception & e) {
|
||||||
printError("exception in database monitor thread: %s", e.what());
|
printError("exception in database monitor thread: %s", e.what());
|
||||||
sleep(30);
|
sleep(30);
|
||||||
|
@ -473,6 +476,9 @@ struct Evaluator
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
loop();
|
loop();
|
||||||
|
} catch (pqxx::broken_connection & e) {
|
||||||
|
printError("Database connection broken: %s", e.what());
|
||||||
|
std::_Exit(1);
|
||||||
} catch (std::exception & e) {
|
} catch (std::exception & e) {
|
||||||
printError("exception in main loop: %s", e.what());
|
printError("exception in main loop: %s", e.what());
|
||||||
sleep(30);
|
sleep(30);
|
||||||
|
|
Loading…
Reference in a new issue