mirror of https://github.com/Icinga/icinga2.git
Merge pull request #8318 from Icinga/bugfix/exceptions-in-config-sync
Catch exceptions in the thread running HandleConfigUpdate
This commit is contained in:
commit
354a854d7a
lib/remote
|
@ -312,7 +312,16 @@ Value ApiListener::ConfigUpdateHandler(const MessageOrigin::Ptr& origin, const D
|
|||
return Empty;
|
||||
}
|
||||
|
||||
std::thread([origin, params]() { HandleConfigUpdate(origin, params); }).detach();
|
||||
std::thread([origin, params, listener]() {
|
||||
try {
|
||||
HandleConfigUpdate(origin, params);
|
||||
} catch (const std::exception& ex) {
|
||||
auto msg ("Exception during config sync: " + DiagnosticInformation(ex));
|
||||
|
||||
Log(LogCritical, "ApiListener") << msg;
|
||||
listener->UpdateLastFailedZonesStageValidation(msg);
|
||||
}
|
||||
}).detach();
|
||||
return Empty;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue