mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Fix missing thread accounting for insert_distributed_sync=1
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
parent
807cf893e8
commit
5d2a97106c
@ -553,8 +553,15 @@ void DistributedSink::onFinish()
|
||||
{
|
||||
if (job.executor)
|
||||
{
|
||||
pool->scheduleOrThrowOnError([&job]()
|
||||
pool->scheduleOrThrowOnError([&job, thread_group = CurrentThread::getGroup()]()
|
||||
{
|
||||
SCOPE_EXIT_SAFE(
|
||||
if (thread_group)
|
||||
CurrentThread::detachFromGroupIfNotDetached();
|
||||
);
|
||||
if (thread_group)
|
||||
CurrentThread::attachToGroupIfDetached(thread_group);
|
||||
|
||||
job.executor->finish();
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user