Merge pull request #1256 from cransom/hydra-evaluator-broken-connection

exit with error if database connectivity lost
This commit is contained in:
Graham Christensen 2022-12-22 19:28:51 -05:00 committed by GitHub
commit f48f00ee6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -366,6 +366,9 @@ struct Evaluator
printInfo("received jobset event");
}
} catch (pqxx::broken_connection & e) {
printError("Database connection broken: %s", e.what());
std::_Exit(1);
} catch (std::exception & e) {
printError("exception in database monitor thread: %s", e.what());
sleep(30);
@ -473,6 +476,9 @@ struct Evaluator
while (true) {
try {
loop();
} catch (pqxx::broken_connection & e) {
printError("Database connection broken: %s", e.what());
std::_Exit(1);
} catch (std::exception & e) {
printError("exception in main loop: %s", e.what());
sleep(30);