Fix data race in context

This commit is contained in:
Kseniia Sumarokova 2023-10-05 15:29:56 +02:00 committed by GitHub
parent 70c3f31926
commit 68a3cd57a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3417,9 +3417,8 @@ void Context::initializeSystemLogs()
/// triggered from another thread, that is launched while initializing the system logs,
/// for example, system.filesystem_cache_log will be triggered by parts loading
/// of any other table if it is stored on a disk with cache.
callOnce(shared->system_logs_initializer, [&] {
shared->system_logs = std::make_unique<SystemLogs>(getGlobalContext(), getConfigRef());
});
auto lock = getGlobalLock();
shared->system_logs = std::make_unique<SystemLogs>(getGlobalContext(), getConfigRef());
}
void Context::initializeTraceCollector()