mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Merge pull request #47098 from CheSema/release-lambda-before
release lambda resources before detaching thread group
This commit is contained in:
commit
bd5d7f3f81
@ -25,8 +25,16 @@ ThreadPoolCallbackRunner<Result, Callback> threadPoolCallbackRunner(ThreadPool &
|
||||
CurrentThread::attachTo(thread_group);
|
||||
|
||||
SCOPE_EXIT_SAFE({
|
||||
{
|
||||
/// Release all captutred resources before detaching thread group
|
||||
/// Releasing has to use proper memory tracker which has been set here before callback
|
||||
|
||||
[[maybe_unused]] auto tmp = std::move(callback);
|
||||
}
|
||||
|
||||
if (thread_group)
|
||||
CurrentThread::detachQueryIfNotDetached();
|
||||
|
||||
});
|
||||
|
||||
setThreadName(thread_name.data());
|
||||
|
Loading…
Reference in New Issue
Block a user