Merge pull request #47309 from ClickHouse/vdimir/fix_live_view_bg_pool_exception

This commit is contained in:
Vladimir C 2023-03-08 10:06:17 +01:00 committed by GitHub
commit 2aec0c1cb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -241,7 +241,18 @@ StorageLiveView::StorageLiveView(
blocks_metadata_ptr = std::make_shared<BlocksMetadataPtr>();
active_ptr = std::make_shared<bool>(true);
periodic_refresh_task = getContext()->getSchedulePool().createTask("LiveViewPeriodicRefreshTask", [this]{ periodicRefreshTaskFunc(); });
periodic_refresh_task = getContext()->getSchedulePool().createTask("LiveViewPeriodicRefreshTask",
[this]
{
try
{
periodicRefreshTaskFunc();
}
catch (...)
{
tryLogCurrentException(log, "Exception in LiveView periodic refresh task in BackgroundSchedulePool");
}
});
periodic_refresh_task->deactivate();
}