Merge pull request #24872 from ClickHouse/fix_background_pool

Paranoid fix for background pool task decrement
This commit is contained in:
alesapin 2021-06-03 11:43:58 +03:00 committed by GitHub
commit 282e8b52c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -116,8 +116,8 @@ try
} }
catch (...) catch (...)
{ {
tryLogCurrentException(__PRETTY_FUNCTION__);
CurrentMetrics::values[pool_config.tasks_metric]--; CurrentMetrics::values[pool_config.tasks_metric]--;
tryLogCurrentException(__PRETTY_FUNCTION__);
scheduleTask(/* with_backoff = */ true); scheduleTask(/* with_backoff = */ true);
} }
}); });
@ -128,8 +128,8 @@ try
catch (...) catch (...)
{ {
/// With our Pool settings scheduleOrThrowOnError shouldn't throw exceptions, but for safety catch added here /// With our Pool settings scheduleOrThrowOnError shouldn't throw exceptions, but for safety catch added here
tryLogCurrentException(__PRETTY_FUNCTION__);
CurrentMetrics::values[pool_config.tasks_metric]--; CurrentMetrics::values[pool_config.tasks_metric]--;
tryLogCurrentException(__PRETTY_FUNCTION__);
scheduleTask(/* with_backoff = */ true); scheduleTask(/* with_backoff = */ true);
} }
} }