Guard BackgroundJobsExecutor from thread termination in case of uncaught exception

This commit is contained in:
Azat Khuzhin 2021-08-05 21:04:11 +03:00
parent 560e71dcfa
commit 5139067631

View File

@ -180,10 +180,16 @@ void IBackgroundJobExecutor::triggerTask()
}
void IBackgroundJobExecutor::backgroundTaskFunction()
try
{
if (!scheduleJob())
scheduleTask(/* with_backoff = */ true);
}
catch (...) /// Catch any exception to avoid thread termination.
{
tryLogCurrentException(__PRETTY_FUNCTION__);
scheduleTask(/* with_backoff = */ true);
}
IBackgroundJobExecutor::~IBackgroundJobExecutor()
{