Repository navigation
Description
Describe the bug
(From Claude)
This is a unsynchronized read/write race on the global ServerSettings object that lives inside ContextSharedPart.
Here's what's happening:
The writer (thread T812, ConfigReloader): During a config reload, Server.cpp:2482 calls Context::setS3QueueDisableStreaming(bool), which does shared->server_settings.set("s3queue_disable_streaming", ...) — a plain non-atomic write of a SettingFieldBool inside the shared settings struct. The only mutex it holds is the ConfigReloader's own reload mutex (M0), which protects against concurrent reloads, not against readers.
The reader (thread T1707, TCPHandler): A query calls getServerSetting(...), and FunctionGetServerSetting::getValue (getServerSetting.cpp:82) does something like ServerSettings settings = context->getServerSettings(); — a full copy-construction of the 6KB ServerSettingsImpl struct via memcpy, with no lock at all. TSan catches the memcpy reading the byte that the reloader is concurrently flipping.
So the bug is that ContextSharedPart::server_settings is treated as immutable-after-startup by readers, but setS3QueueDisableStreaming (a relatively new runtime-mutable knob) made it mutable, and neither side agrees on a synchronization protocol.
Reasonable fixes, roughly in order of cleanliness:
Put server_settings behind the existing shared context mutex (or its own dedicated mutex). setS3QueueDisableStreaming takes the lock to write; Context::getServerSettings() either returns a copy made under the lock, or callers that need a snapshot (like getServerSetting.cpp) copy under the lock. Given the struct is copied anyway in the offending path, a "copy under lock" accessor is a small change.
Use MultiVersion (ClickHouse already has this pattern for config-reloadable state, e.g. macros and remote host filters). The reloader publishes a new version; readers grab a consistent snapshot via shared->server_settings.get(). This is the most idiomatic fix for ClickHouse's reload model, though a bigger refactor since lots of code touches server settings directly.
How to reproduce
No response
Error message and/or stacktrace
Error:
WARNING: ThreadSanitizer: data race (pid=2152)
Read of size 8 at 0x728c0000a830 by thread T1707:
---
Stack trace:
WARNING: ThreadSanitizer: data race (pid=2152)
Read of size 8 at 0x728c0000a830 by thread T1707:
#0 __tsan_memcpy <null> (clickhouse+0xc918d0f) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#1 DB::ServerSettingsTraits::Data::Data(DB::ServerSettingsTraits::Data const&) src/Core/ServerSettings.cpp:1667:1 (clickhouse+0x220fce07) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#2 DB::BaseSettings<DB::ServerSettingsTraits>::BaseSettings(DB::BaseSettings<DB::ServerSettingsTraits> const&) src/Core/BaseSettings.h:155:5 (clickhouse+0x220fce07)
#3 DB::ServerSettingsImpl::ServerSettingsImpl(DB::ServerSettingsImpl const&) src/Core/ServerSettings.cpp:1669:8 (clickhouse+0x220fce07)
#4 std::__1::unique_ptr<DB::ServerSettingsImpl, std::__1::default_delete<DB::ServerSettingsImpl>> std::__1::make_unique[abi:fqe220101]<DB::ServerSettingsImpl, DB::ServerSettingsImpl&, 0>(DB::ServerSettingsImpl&) contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:770:30 (clickhouse+0x220fce07)
#5 DB::ServerSettings::ServerSettings(DB::ServerSettings const&) src/Core/ServerSettings.cpp:1721:72 (clickhouse+0x220fce07)
#6 DB::(anonymous namespace)::FunctionGetServerSetting::getValue(std::__1::vector<DB::ColumnWithTypeAndName, AllocatorWithMemoryTracking<DB::ColumnWithTypeAndName>> const&) const src/Functions/getServerSetting.cpp:82:28 (clickhouse+0x10b37bba) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#7 DB::(anonymous namespace)::FunctionGetServerSetting::getReturnTypeImpl(std::__1::vector<DB::ColumnWithTypeAndName, AllocatorWithMemoryTracking<DB::ColumnWithTypeAndName>> const&) const src/Functions/getServerSetting.cpp:41:22 (clickhouse+0x10b379e2) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#8 DB::FunctionToOverloadResolverAdaptor::getReturnTypeImpl(std::__1::vector<DB::ColumnWithTypeAndName, AllocatorWithMemoryTracking<DB::ColumnWithTypeAndName>> const&) const src/Functions/IFunctionAdaptors.h:142:111 (clickhouse+0x10080eb9) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#9 DB::IFunctionOverloadResolver::getReturnTypeWithoutLowCardinality(std::__1::vector<DB::ColumnWithTypeAndName, AllocatorWithMemoryTracking<DB::ColumnWithTypeAndName>> const&) const src/Functions/IFunction.cpp:818:12 (clickhouse+0x205b2a4e) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#10 DB::IFunctionOverloadResolver::getReturnType(std::__1::vector<DB::ColumnWithTypeAndName, AllocatorWithMemoryTracking<DB::ColumnWithTypeAndName>> const&) const src/Functions/IFunction.cpp:731:45 (clickhouse+0x205b24ad) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#11 DB::IFunctionOverloadResolver::build(std::__1::vector<DB::ColumnWithTypeAndName, AllocatorWithMemoryTracking<DB::ColumnWithTypeAndName>> const&) const src/Functions/IFunction.cpp:775:24 (clickhouse+0x205b2e25) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#12 DB::QueryAnalyzer::resolveFunction(std::__1::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, bool) src/Analyzer/Resolve/resolveFunction.cpp:1849:45 (clickhouse+0x232870d9) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#13 DB::QueryAnalyzer::resolveExpressionNode(std::__1::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, bool, bool, bool, bool) src/Analyzer/Resolve/QueryAnalyzer.cpp:3300:46 (clickhouse+0x22d67f02) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#14 DB::QueryAnalyzer::resolveExpressionNodeList(std::__1::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, bool, bool, bool) src/Analyzer/Resolve/QueryAnalyzer.cpp:3452:49 (clickhouse+0x22d66db9) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#15 DB::QueryAnalyzer::resolveFunction(std::__1::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, bool) src/Analyzer/Resolve/resolveFunction.cpp:1081:39 (clickhouse+0x232808ad) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#16 DB::QueryAnalyzer::resolveExpressionNode(std::__1::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, bool, bool, bool, bool) src/Analyzer/Resolve/QueryAnalyzer.cpp:3300:46 (clickhouse+0x22d67f02) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#17 DB::QueryAnalyzer::resolveExpressionNodeList(std::__1::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, bool, bool, bool) src/Analyzer/Resolve/QueryAnalyzer.cpp:3452:49 (clickhouse+0x22d66db9) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#18 DB::QueryAnalyzer::resolveFunction(std::__1::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, bool) src/Analyzer/Resolve/resolveFunction.cpp:1081:39 (clickhouse+0x232808ad) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#19 DB::QueryAnalyzer::resolveExpressionNode(std::__1::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, bool, bool, bool, bool) src/Analyzer/Resolve/QueryAnalyzer.cpp:3300:46 (clickhouse+0x22d67f02) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#20 DB::QueryAnalyzer::resolveExpressionNodeList(std::__1::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, bool, bool, bool) src/Analyzer/Resolve/QueryAnalyzer.cpp:3452:49 (clickhouse+0x22d66db9) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#21 DB::QueryAnalyzer::resolveProjectionExpressionNodeList(std::__1::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&) src/Analyzer/Resolve/QueryAnalyzer.cpp:3766:40 (clickhouse+0x22d98908) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#22 DB::QueryAnalyzer::resolveQuery(std::__1::shared_ptr<DB::IQueryTreeNode> const&, DB::IdentifierResolveScope&) src/Analyzer/Resolve/QueryAnalyzer.cpp:5761:30 (clickhouse+0x22d5f067) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#23 DB::QueryAnalyzer::resolve(std::__1::shared_ptr<DB::IQueryTreeNode>&, std::__1::shared_ptr<DB::IQueryTreeNode> const&, std::__1::shared_ptr<DB::Context const>) src/Analyzer/Resolve/QueryAnalyzer.cpp:247:13 (clickhouse+0x22d5d2b5) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#24 DB::QueryAnalysisPass::run(std::__1::shared_ptr<DB::IQueryTreeNode>&, std::__1::shared_ptr<DB::Context const>) src/Analyzer/Resolve/QueryAnalysisPass.cpp:18:14 (clickhouse+0x22d5c010) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#25 DB::QueryTreePassManager::run(std::__1::shared_ptr<DB::IQueryTreeNode>&) src/Analyzer/QueryTreePassManager.cpp:199:20 (clickhouse+0x22df5a3e) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#26 DB::buildQueryTreeAndRunPasses(boost::intrusive_ptr<DB::IAST> const&, DB::SelectQueryOptions const&, std::__1::shared_ptr<DB::Context const> const&, std::__1::shared_ptr<DB::IStorage> const&) src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:256:33 (clickhouse+0x243e047f) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#27 DB::InterpreterSelectQueryAnalyzer::InterpreterSelectQueryAnalyzer(boost::intrusive_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::Context const> const&, DB::SelectQueryOptions const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, DB::ActionsDAG const*) src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:274:18 (clickhouse+0x243dd029) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#28 std::__1::unique_ptr<DB::InterpreterSelectQueryAnalyzer, std::__1::default_delete<DB::InterpreterSelectQueryAnalyzer>> std::__1::make_unique[abi:fqe220101]<DB::InterpreterSelectQueryAnalyzer, boost::intrusive_ptr<DB::IAST>&, std::__1::shared_ptr<DB::Context> const&, DB::SelectQueryOptions const&, 0>(boost::intrusive_ptr<DB::IAST>&, std::__1::shared_ptr<DB::Context> const&, DB::SelectQueryOptions const&) contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:770:30 (clickhouse+0x243e95a7) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#29 DB::registerInterpreterSelectQueryAnalyzer(DB::InterpreterFactory&)::$_0::operator()(DB::InterpreterFactory::Arguments const&) const src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:412:16 (clickhouse+0x243e92bc) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#30 std::__1::__invoke_result_impl<void, DB::registerInterpreterSelectQueryAnalyzer(DB::InterpreterFactory&)::$_0&, DB::InterpreterFactory::Arguments const&>::type std::__1::__invoke[abi:fqe220101]<DB::registerInterpreterSelectQueryAnalyzer(DB::InterpreterFactory&)::$_0&, DB::InterpreterFactory::Arguments const&>(DB::registerInterpreterSelectQueryAnalyzer(DB::InterpreterFactory&)::$_0&, DB::InterpreterFactory::Arguments const&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:90:27 (clickhouse+0x243e92bc)
#31 std::__1::unique_ptr<DB::IInterpreter, std::__1::default_delete<DB::IInterpreter>> std::__1::__invoke_void_return_wrapper<std::__1::unique_ptr<DB::IInterpreter, std::__1::default_delete<DB::IInterpreter>>, false>::__call[abi:fqe220101]<DB::registerInterpreterSelectQueryAnalyzer(DB::InterpreterFactory&)::$_0&, DB::InterpreterFactory::Arguments const&>(DB::registerInterpreterSelectQueryAnalyzer(DB::InterpreterFactory&)::$_0&, DB::InterpreterFactory::Arguments const&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:342:12 (clickhouse+0x243e92bc)
#32 std::__1::unique_ptr<DB::IInterpreter, std::__1::default_delete<DB::IInterpreter>> std::__1::__invoke_r[abi:fqe220101]<std::__1::unique_ptr<DB::IInterpreter, std::__1::default_delete<DB::IInterpreter>>, DB::registerInterpreterSelectQueryAnalyzer(DB::InterpreterFactory&)::$_0&, DB::InterpreterFactory::Arguments const&>(DB::registerInterpreterSelectQueryAnalyzer(DB::InterpreterFactory&)::$_0&, DB::InterpreterFactory::Arguments const&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:356:10 (clickhouse+0x243e92bc)
#33 std::__1::unique_ptr<DB::IInterpreter, std::__1::default_delete<DB::IInterpreter>> std::__1::__function::__policy_func<std::__1::unique_ptr<DB::IInterpreter, std::__1::default_delete<DB::IInterpreter>> (DB::InterpreterFactory::Arguments const&)>::__call_func[abi:fqe220101]<DB::registerInterpreterSelectQueryAnalyzer(DB::InterpreterFactory&)::$_0>(std::__1::__function::__policy_storage const*, DB::InterpreterFactory::Arguments const&) contrib/llvm-project/libcxx/include/__functional/function.h:443:12 (clickhouse+0x243e92bc)
#34 std::__1::__function::__policy_func<std::__1::unique_ptr<DB::IInterpreter, std::__1::default_delete<DB::IInterpreter>> (DB::InterpreterFactory::Arguments const&)>::operator()[abi:fqe220101](DB::InterpreterFactory::Arguments const&) const contrib/llvm-project/libcxx/include/__functional/function.h:502:12 (clickhouse+0x24363fe8) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#35 std::__1::function<std::__1::unique_ptr<DB::IInterpreter, std::__1::default_delete<DB::IInterpreter>> (DB::InterpreterFactory::Arguments const&)>::operator()(DB::InterpreterFactory::Arguments const&) const contrib/llvm-project/libcxx/include/__functional/function.h:754:10 (clickhouse+0x24363fe8)
#36 DB::InterpreterFactory::get(boost::intrusive_ptr<DB::IAST>&, std::__1::shared_ptr<DB::Context>, DB::SelectQueryOptions const&) src/Interpreters/InterpreterFactory.cpp:410:12 (clickhouse+0x24363fe8)
#37 DB::executeQueryImpl(char const*, char const*, std::__1::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer>>&, boost::intrusive_ptr<DB::IAST>&, std::__1::shared_ptr<DB::ImplicitTransactionControlExecutor>, std::__1::function<void ()>, DB::QueryResultDetails&) src/Interpreters/executeQuery.cpp:1750:66 (clickhouse+0x249be3b0) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#38 DB::executeQuery(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) src/Interpreters/executeQuery.cpp:2196:11 (clickhouse+0x249b6859) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#39 DB::TCPHandler::runImpl() src/Server/TCPHandler.cpp:832:68 (clickhouse+0x2e6e6dc5) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#40 DB::TCPHandler::run() src/Server/TCPHandler.cpp:3075:9 (clickhouse+0x2e71a6e7) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#41 Poco::Net::TCPServerConnection::start() base/poco/Net/src/TCPServerConnection.cpp:40:3 (clickhouse+0x39fa40a2) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#42 Poco::Net::TCPServerDispatcher::run() base/poco/Net/src/TCPServerDispatcher.cpp:115:42 (clickhouse+0x39fa49bc) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#43 Poco::PooledThread::run() base/poco/Foundation/src/ThreadPool.cpp:207:14 (clickhouse+0x39f010d0) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#44 Poco::(anonymous namespace)::RunnableHolder::run() base/poco/Foundation/src/Thread.cpp:45:11 (clickhouse+0x39efeb2f) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#45 Poco::ThreadImpl::runnableEntry(void*) base/poco/Foundation/src/Thread_POSIX.cpp:341:27 (clickhouse+0x39efcf49) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
Previous write of size 1 at 0x728c0000a837 by thread T812 (mutexes: write M0):
#0 DB::SettingFieldNumber<bool>::operator=(bool) src/Core/SettingsFields.cpp:187:13 (clickhouse+0x2239d674) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#1 DB::SettingFieldNumber<bool>::operator=(DB::Field const&) src/Core/SettingsFields.cpp:199:11 (clickhouse+0x2239d674)
#2 void DB::settingFieldAssignFromField<DB::SettingFieldNumber<bool>>(void*, DB::Field const&) src/Core/SettingsFields.h:45:106 (clickhouse+0x1d97f7a0) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#3 DB::ServerSettingsTraits::Accessor::setValue(DB::ServerSettingsTraits::Data&, unsigned long, DB::Field const&) const src/Core/ServerSettings.cpp:1667:1 (clickhouse+0x2210f60f) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#4 DB::BaseSettings<DB::ServerSettingsTraits>::set(std::__1::basic_string_view<char, std::__1::char_traits<char>>, DB::Field const&) src/Core/BaseSettings.h:376:18 (clickhouse+0x2210f60f)
#5 DB::ServerSettings::set(std::__1::basic_string_view<char, std::__1::char_traits<char>>, DB::Field const&) src/Core/ServerSettings.cpp:1736:11 (clickhouse+0x220fd746) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#6 DB::Context::setS3QueueDisableStreaming(bool) const src/Interpreters/Context.cpp:5823:29 (clickhouse+0x23f58105) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#7 DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_5::operator()(Poco::AutoPtr<Poco::Util::AbstractConfiguration>, bool) const programs/server/Server.cpp:2482:29 (clickhouse+0x19be1790) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#8 std::__1::__invoke_result_impl<void, DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_5&, Poco::AutoPtr<Poco::Util::AbstractConfiguration>, bool>::type std::__1::__invoke[abi:fqe220101]<DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_5&, Poco::AutoPtr<Poco::Util::AbstractConfiguration>, bool>(DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_5&, Poco::AutoPtr<Poco::Util::AbstractConfiguration>&&, bool&&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:90:27 (clickhouse+0x19bdeba9) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#9 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:fqe220101]<DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_5&, Poco::AutoPtr<Poco::Util::AbstractConfiguration>, bool>(DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_5&, Poco::AutoPtr<Poco::Util::AbstractConfiguration>&&, bool&&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:350:5 (clickhouse+0x19bdeba9)
#10 void std::__1::__invoke_r[abi:fqe220101]<void, DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_5&, Poco::AutoPtr<Poco::Util::AbstractConfiguration>, bool>(DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_5&, Poco::AutoPtr<Poco::Util::AbstractConfiguration>&&, bool&&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:356:10 (clickhouse+0x19bdeba9)
#11 void std::__1::__function::__policy_func<void (Poco::AutoPtr<Poco::Util::AbstractConfiguration>, bool)>::__call_func[abi:fqe220101]<DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_5>(std::__1::__function::__policy_storage const*, Poco::AutoPtr<Poco::Util::AbstractConfiguration>&&, bool) contrib/llvm-project/libcxx/include/__functional/function.h:443:12 (clickhouse+0x19bdeba9)
#12 std::__1::__function::__policy_func<void (Poco::AutoPtr<Poco::Util::AbstractConfiguration>, bool)>::operator()[abi:fqe220101](Poco::AutoPtr<Poco::Util::AbstractConfiguration>&&, bool&&) const contrib/llvm-project/libcxx/include/__functional/function.h:502:12 (clickhouse+0x2fc6af06) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#13 std::__1::function<void (Poco::AutoPtr<Poco::Util::AbstractConfiguration>, bool)>::operator()(Poco::AutoPtr<Poco::Util::AbstractConfiguration>, bool) const contrib/llvm-project/libcxx/include/__functional/function.h:754:10 (clickhouse+0x2fc6af06)
#14 DB::ConfigReloader::reloadIfNewer(bool, bool, bool, bool) src/Common/Config/ConfigReloader.cpp:178:13 (clickhouse+0x2fc6af06)
#15 DB::ConfigReloader::run() src/Common/Config/ConfigReloader.cpp:96:27 (clickhouse+0x2fc6d6e2) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#16 std::__1::__invoke_result_impl<void, void (DB::ConfigReloader::*&)(), DB::ConfigReloader*&>::type std::__1::__invoke[abi:fqe220101]<void (DB::ConfigReloader::*&)(), DB::ConfigReloader*&>(void (DB::ConfigReloader::*&)(), DB::ConfigReloader*&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h (clickhouse+0x2fc6f8e1) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#17 decltype(auto) std::__1::__apply_tuple_impl[abi:fqe220101]<void (DB::ConfigReloader::*&)(), std::__1::tuple<DB::ConfigReloader*>&, 0ul>(void (DB::ConfigReloader::*&)(), std::__1::tuple<DB::ConfigReloader*>&, std::__1::integer_sequence<unsigned long, 0ul>) contrib/llvm-project/libcxx/include/tuple:1400:5 (clickhouse+0x2fc6f8e1)
#18 decltype(auto) std::__1::apply[abi:fqe220101]<void (DB::ConfigReloader::*&)(), std::__1::tuple<DB::ConfigReloader*>&>(void (DB::ConfigReloader::*&)(), std::__1::tuple<DB::ConfigReloader*>&) contrib/llvm-project/libcxx/include/tuple:1404:5 (clickhouse+0x2fc6f8e1)
#19 ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<void (DB::ConfigReloader::*)(), DB::ConfigReloader*>(void (DB::ConfigReloader::*&&)(), DB::ConfigReloader*&&)::'lambda'()::operator()() src/Common/ThreadPool.h:298:17 (clickhouse+0x2fc6f8e1)
#20 std::__1::__invoke_result_impl<void, ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<void (DB::ConfigReloader::*)(), DB::ConfigReloader*>(void (DB::ConfigReloader::*&&)(), DB::ConfigReloader*&&)::'lambda'()&>::type std::__1::__invoke[abi:fqe220101]<ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<void (DB::ConfigReloader::*)(), DB::ConfigReloader*>(void (DB::ConfigReloader::*&&)(), DB::ConfigReloader*&&)::'lambda'()&>(ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<void (DB::ConfigReloader::*)(), DB::ConfigReloader*>(void (DB::ConfigReloader::*&&)(), DB::ConfigReloader*&&)::'lambda'()&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:90:27 (clickhouse+0x2fc6f8e1)
#21 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:fqe220101]<ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<void (DB::ConfigReloader::*)(), DB::ConfigReloader*>(void (DB::ConfigReloader::*&&)(), DB::ConfigReloader*&&)::'lambda'()&>(ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<void (DB::ConfigReloader::*)(), DB::ConfigReloader*>(void (DB::ConfigReloader::*&&)(), DB::ConfigReloader*&&)::'lambda'()&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:350:5 (clickhouse+0x2fc6f8e1)
#22 void (DB::ConfigReloader::*std::__1::__invoke_r[abi:fqe220101]<void, ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<void (DB::ConfigReloader::*)(), DB::ConfigReloader*>(void (DB::ConfigReloader::*&&)(), DB::ConfigReloader*&&)::'lambda'()&>(DB::ConfigReloader*&&))() contrib/llvm-project/libcxx/include/__type_traits/invoke.h:356:10 (clickhouse+0x2fc6f8e1)
#23 void std::__1::__function::__policy_func<void ()>::__call_func[abi:fqe220101]<ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<void (DB::ConfigReloader::*)(), DB::ConfigReloader*>(void (DB::ConfigReloader::*&&)(), DB::ConfigReloader*&&)::'lambda'()>(std::__1::__function::__policy_storage const*) contrib/llvm-project/libcxx/include/__functional/function.h:443:12 (clickhouse+0x2fc6f8e1)
#24 std::__1::__function::__policy_func<void ()>::operator()[abi:fqe220101]() const contrib/llvm-project/libcxx/include/__functional/function.h:502:12 (clickhouse+0x1987802e) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#25 std::__1::function<void ()>::operator()() const contrib/llvm-project/libcxx/include/__functional/function.h:754:10 (clickhouse+0x1987802e)
#26 startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0::operator()() src/Common/ThreadPool.cpp:961:13 (clickhouse+0x1987802e)
#27 std::__1::__invoke_result_impl<void, startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&>::type std::__1::__invoke[abi:fqe220101]<startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&>(startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:90:27 (clickhouse+0x1987802e)
#28 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:fqe220101]<startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&>(startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:350:5 (clickhouse+0x1987802e)
#29 void std::__1::__invoke_r[abi:fqe220101]<void, startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&>(startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:356:10 (clickhouse+0x1987802e)
#30 void std::__1::__function::__policy_func<void ()>::__call_func[abi:fqe220101]<startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0>(std::__1::__function::__policy_storage const*) contrib/llvm-project/libcxx/include/__functional/function.h:443:12 (clickhouse+0x1987802e)
#31 std::__1::__function::__policy_func<void ()>::operator()[abi:fqe220101]() const contrib/llvm-project/libcxx/include/__functional/function.h:502:12 (clickhouse+0x19879497) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#32 std::__1::function<void ()>::operator()() const contrib/llvm-project/libcxx/include/__functional/function.h:754:10 (clickhouse+0x19879497)
#33 ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::worker() src/Common/ThreadPool.cpp:812:17 (clickhouse+0x19879497)
#34 std::__1::__invoke_result_impl<void, void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*>::type std::__1::__invoke[abi:fqe220101]<void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*>(void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*&&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h (clickhouse+0x19883adb) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#35 void std::__1::__thread_execute[abi:fqe220101]<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*, 0ul, 1ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*>&, std::__1::__integer_sequence<unsigned long, 0ul, 1ul>) contrib/llvm-project/libcxx/include/__thread/thread.h:161:3 (clickhouse+0x19883adb)
#36 void* std::__1::__thread_proxy[abi:fqe220101]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*>>(void*) contrib/llvm-project/libcxx/include/__thread/thread.h:169:3 (clickhouse+0x19883adb)
Location is heap block of size 6392 at 0x728c0000a800 allocated by main thread:
#0 operator new(unsigned long) <null> (clickhouse+0xc9c455d) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#1 std::__1::unique_ptr<DB::ServerSettingsImpl, std::__1::default_delete<DB::ServerSettingsImpl>> std::__1::make_unique[abi:fqe220101]<DB::ServerSettingsImpl, 0>() contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:770:26 (clickhouse+0x220fcd1f) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#2 DB::ServerSettings::ServerSettings() src/Core/ServerSettings.cpp:1717:41 (clickhouse+0x220fcd1f)
#3 DB::ContextSharedPart::ContextSharedPart() src/Interpreters/Context.cpp:744:5 (clickhouse+0x23f956da) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#4 std::__1::unique_ptr<DB::ContextSharedPart, std::__1::default_delete<DB::ContextSharedPart>> std::__1::make_unique[abi:fqe220101]<DB::ContextSharedPart, 0>() contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:770:30 (clickhouse+0x23f088a7) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#5 DB::Context::createShared() src/Interpreters/Context.cpp:1329:32 (clickhouse+0x23f088a7)
#6 DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&) programs/server/Server.cpp:1396:27 (clickhouse+0x19b96af2) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#7 Poco::Util::Application::run() base/poco/Util/src/Application.cpp:315:8 (clickhouse+0x39fdfdbe) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#8 DB::Server::run() programs/server/Server.cpp:748:25 (clickhouse+0x19b80e7d) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#9 Poco::Util::ServerApplication::run(int, char**) base/poco/Util/src/ServerApplication.cpp:131:9 (clickhouse+0x39ffe02b) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#10 mainEntryClickHouseServer(int, char**) programs/server/Server.cpp:524:20 (clickhouse+0x19b7e1e7) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#11 main programs/main.cpp:429:21 (clickhouse+0xc9c6de8) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
Mutex M0 (0x72400000b6d0) created at:
#0 pthread_mutex_lock <null> (clickhouse+0xc91f07d) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#1 std::__1::__libcpp_mutex_lock[abi:fqe220101](pthread_mutex_t*) contrib/llvm-project/libcxx/include/__thread/support/pthread.h:95:10 (clickhouse+0x40f0b459) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#2 std::__1::mutex::lock() contrib/llvm-project/libcxx/src/mutex.cpp:30:12 (clickhouse+0x40f0b459)
#3 std::__1::lock_guard<std::__1::mutex>::lock_guard[abi:fqe220101](std::__1::mutex&) contrib/llvm-project/libcxx/include/__mutex/lock_guard.h:32:10 (clickhouse+0x2fc69bca) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#4 DB::ConfigReloader::reloadIfNewer(bool, bool, bool, bool) src/Common/Config/ConfigReloader.cpp:118:21 (clickhouse+0x2fc69bca)
#5 DB::ConfigReloader::ConfigReloader(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::unique_ptr<zkutil::ZooKeeperNodeCache, std::__1::default_delete<zkutil::ZooKeeperNodeCache>>&&, std::__1::shared_ptr<Poco::Event> const&, std::__1::function<void (Poco::AutoPtr<Poco::Util::AbstractConfiguration>, bool)>&&) src/Common/Config/ConfigReloader.cpp:37:19 (clickhouse+0x2fc68d2b) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#6 std::__1::unique_ptr<DB::ConfigReloader, std::__1::default_delete<DB::ConfigReloader>> std::__1::make_unique[abi:fqe220101]<DB::ConfigReloader, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>&, DB::SettingFieldString&, std::__1::unique_ptr<zkutil::ZooKeeperNodeCache, std::__1::default_delete<zkutil::ZooKeeperNodeCache>>, std::__1::shared_ptr<Poco::Event>&, DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_5, 0>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>&, DB::SettingFieldString&, std::__1::unique_ptr<zkutil::ZooKeeperNodeCache, std::__1::default_delete<zkutil::ZooKeeperNodeCache>>&&, std::__1::shared_ptr<Poco::Event>&, DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_5&&) contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:770:30 (clickhouse+0x19baa41d) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#7 DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&) programs/server/Server.cpp:2361:33 (clickhouse+0x19baa41d)
#8 Poco::Util::Application::run() base/poco/Util/src/Application.cpp:315:8 (clickhouse+0x39fdfdbe) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#9 DB::Server::run() programs/server/Server.cpp:748:25 (clickhouse+0x19b80e7d) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#10 Poco::Util::ServerApplication::run(int, char**) base/poco/Util/src/ServerApplication.cpp:131:9 (clickhouse+0x39ffe02b) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#11 mainEntryClickHouseServer(int, char**) programs/server/Server.cpp:524:20 (clickhouse+0x19b7e1e7) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#12 main programs/main.cpp:429:21 (clickhouse+0xc9c6de8) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
Thread T1707 'TCPHandler' (tid=5522, running) created by thread T817 at:
#0 pthread_create <null> (clickhouse+0xc91d4ac) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#1 Poco::ThreadImpl::startImpl(Poco::SharedPtr<Poco::Runnable, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::Runnable>>) base/poco/Foundation/src/Thread_POSIX.cpp:203:7 (clickhouse+0x39efc794) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#2 Poco::Thread::start(Poco::Runnable&) base/poco/Foundation/src/Thread.cpp:118:2 (clickhouse+0x39efe3ef) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#3 Poco::PooledThread::start() base/poco/Foundation/src/ThreadPool.cpp:93:10 (clickhouse+0x39f02f00) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#4 Poco::ThreadPool::getThread() base/poco/Foundation/src/ThreadPool.cpp:473:14 (clickhouse+0x39f02f00)
#5 Poco::ThreadPool::startWithPriority(Poco::Thread::Priority, Poco::Runnable&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) base/poco/Foundation/src/ThreadPool.cpp:377:2 (clickhouse+0x39f032e7) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#6 Poco::Net::TCPServerDispatcher::enqueue(Poco::Net::StreamSocket const&) base/poco/Net/src/TCPServerDispatcher.cpp:168:29 (clickhouse+0x39fa5d61) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#7 Poco::Net::TCPServer::run() base/poco/Net/src/TCPServer.cpp:148:39 (clickhouse+0x39fa34d3) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#8 Poco::(anonymous namespace)::RunnableHolder::run() base/poco/Foundation/src/Thread.cpp:45:11 (clickhouse+0x39efeb2f) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#9 Poco::ThreadImpl::runnableEntry(void*) base/poco/Foundation/src/Thread_POSIX.cpp:341:27 (clickhouse+0x39efcf49) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
Thread T812 'ConfigReloader' (tid=2981, running) created by thread T811 at:
#0 pthread_create <null> (clickhouse+0xc91d4ac) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#1 std::__1::__libcpp_thread_create[abi:fqe220101](unsigned long*, void* (*)(void*), void*) contrib/llvm-project/libcxx/include/__thread/support/pthread.h:182:10 (clickhouse+0x1987a399) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#2 std::__1::thread::thread[abi:fqe220101]<void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*, 0>(void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*&&) contrib/llvm-project/libcxx/include/__thread/thread.h:218:16 (clickhouse+0x1987a399)
#3 ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::ThreadFromThreadPool(ThreadPoolImpl<std::__1::thread>&) src/Common/ThreadPool.cpp:614:14 (clickhouse+0x198784ed) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#4 std::__1::unique_ptr<ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool, std::__1::default_delete<ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool>> std::__1::make_unique[abi:fqe220101]<ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool, ThreadPoolImpl<std::__1::thread>&, 0>(ThreadPoolImpl<std::__1::thread>&) contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:770:30 (clickhouse+0x1987ac9b) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#5 void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, Priority, std::__1::optional<unsigned long>, bool) src/Common/ThreadPool.cpp:302:30 (clickhouse+0x1987ac9b)
#6 ThreadPoolImpl<std::__1::thread>::scheduleOrThrow(std::__1::function<void ()>, Priority, unsigned long, bool) src/Common/ThreadPool.cpp:506:5 (clickhouse+0x19876799) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#7 startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool) src/Common/ThreadPool.cpp:937:34 (clickhouse+0x19876799)
#8 ThreadFromGlobalPoolImpl<false, true>::ThreadFromGlobalPoolImpl<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&&) src/Common/ThreadPool.h:293:9 (clickhouse+0x1987e77b) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#9 ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::ThreadFromThreadPool(ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>&) src/Common/ThreadPool.cpp:614:14 (clickhouse+0x1987c71b) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#10 std::__1::unique_ptr<ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool, std::__1::default_delete<ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool>> std::__1::make_unique[abi:fqe220101]<ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>&, 0>(ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>&) contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:770:30 (clickhouse+0x1987f41b) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#11 void ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::scheduleImpl<void>(std::__1::function<void ()>, Priority, std::__1::optional<unsigned long>, bool) src/Common/ThreadPool.cpp:302:30 (clickhouse+0x1987f41b)
#12 ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::scheduleOrThrowOnError(std::__1::function<void ()>, Priority) src/Common/ThreadPool.cpp:494:5 (clickhouse+0x1987f244) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#13 DB::AsyncLoader::spawn(DB::AsyncLoader::Pool&, std::__1::unique_lock<std::__1::mutex>&) src/Common/AsyncLoader.cpp:908:5 (clickhouse+0x19b5fb20) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#14 DB::AsyncLoader::enqueue(DB::AsyncLoader::Info&, std::__1::shared_ptr<DB::LoadJob> const&, std::__1::unique_lock<std::__1::mutex>&) src/Common/AsyncLoader.cpp:744:9 (clickhouse+0x19b5c395) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#15 DB::AsyncLoader::finish(std::__1::shared_ptr<DB::LoadJob> const&, DB::LoadStatus, std::exception_ptr, std::__1::unique_lock<std::__1::mutex>&) src/Common/AsyncLoader.cpp:658:13 (clickhouse+0x19b5ce21) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#16 DB::AsyncLoader::worker(DB::AsyncLoader::Pool&) src/Common/AsyncLoader.cpp:936:17 (clickhouse+0x19b61d09) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#17 DB::AsyncLoader::spawn(DB::AsyncLoader::Pool&, std::__1::unique_lock<std::__1::mutex>&)::$_0::operator()() const src/Common/AsyncLoader.cpp:908:5 (clickhouse+0x19b637f2) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#18 std::__1::__invoke_result_impl<void, DB::AsyncLoader::spawn(DB::AsyncLoader::Pool&, std::__1::unique_lock<std::__1::mutex>&)::$_0&>::type std::__1::__invoke[abi:fqe220101]<DB::AsyncLoader::spawn(DB::AsyncLoader::Pool&, std::__1::unique_lock<std::__1::mutex>&)::$_0&>(DB::AsyncLoader::spawn(DB::AsyncLoader::Pool&, std::__1::unique_lock<std::__1::mutex>&)::$_0&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:90:27 (clickhouse+0x19b637f2)
#19 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:fqe220101]<DB::AsyncLoader::spawn(DB::AsyncLoader::Pool&, std::__1::unique_lock<std::__1::mutex>&)::$_0&>(DB::AsyncLoader::spawn(DB::AsyncLoader::Pool&, std::__1::unique_lock<std::__1::mutex>&)::$_0&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:350:5 (clickhouse+0x19b637f2)
#20 void std::__1::__invoke_r[abi:fqe220101]<void, DB::AsyncLoader::spawn(DB::AsyncLoader::Pool&, std::__1::unique_lock<std::__1::mutex>&)::$_0&>(DB::AsyncLoader::spawn(DB::AsyncLoader::Pool&, std::__1::unique_lock<std::__1::mutex>&)::$_0&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:356:10 (clickhouse+0x19b637f2)
#21 void std::__1::__function::__policy_func<void ()>::__call_func[abi:fqe220101]<DB::AsyncLoader::spawn(DB::AsyncLoader::Pool&, std::__1::unique_lock<std::__1::mutex>&)::$_0>(std::__1::__function::__policy_storage const*) contrib/llvm-project/libcxx/include/__functional/function.h:443:12 (clickhouse+0x19b637f2)
#22 std::__1::__function::__policy_func<void ()>::operator()[abi:fqe220101]() const contrib/llvm-project/libcxx/include/__functional/function.h:502:12 (clickhouse+0x1987d12d) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#23 std::__1::function<void ()>::operator()() const contrib/llvm-project/libcxx/include/__functional/function.h:754:10 (clickhouse+0x1987d12d)
#24 ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::worker() src/Common/ThreadPool.cpp:802:17 (clickhouse+0x1987d12d)
#25 std::__1::__invoke_result_impl<void, void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&>::type std::__1::__invoke[abi:fqe220101]<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h (clickhouse+0x19887261) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#26 decltype(auto) std::__1::__apply_tuple_impl[abi:fqe220101]<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&)(), std::__1::tuple<ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>&, 0ul>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&)(), std::__1::tuple<ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>&, std::__1::integer_sequence<unsigned long, 0ul>) contrib/llvm-project/libcxx/include/tuple:1400:5 (clickhouse+0x19887261)
#27 decltype(auto) std::__1::apply[abi:fqe220101]<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&)(), std::__1::tuple<ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>&>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&)(), std::__1::tuple<ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>&) contrib/llvm-project/libcxx/include/tuple:1404:5 (clickhouse+0x19887261)
#28 ThreadFromGlobalPoolImpl<false, true>::ThreadFromGlobalPoolImpl<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&&)::'lambda'()::operator()() src/Common/ThreadPool.h:298:17 (clickhouse+0x19887261)
#29 std::__1::__invoke_result_impl<void, ThreadFromGlobalPoolImpl<false, true>::ThreadFromGlobalPoolImpl<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&&)::'lambda'()&>::type std::__1::__invoke[abi:fqe220101]<ThreadFromGlobalPoolImpl<false, true>::ThreadFromGlobalPoolImpl<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&&)::'lambda'()&>(ThreadFromGlobalPoolImpl<false, true>::ThreadFromGlobalPoolImpl<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&&)::'lambda'()&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:90:27 (clickhouse+0x19887261)
#30 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:fqe220101]<ThreadFromGlobalPoolImpl<false, true>::ThreadFromGlobalPoolImpl<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&&)::'lambda'()&>(ThreadFromGlobalPoolImpl<false, true>::ThreadFromGlobalPoolImpl<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&&)::'lambda'()&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:350:5 (clickhouse+0x19887261)
#31 void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*std::__1::__invoke_r[abi:fqe220101]<void, ThreadFromGlobalPoolImpl<false, true>::ThreadFromGlobalPoolImpl<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&&)::'lambda'()&>(ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&&))() contrib/llvm-project/libcxx/include/__type_traits/invoke.h:356:10 (clickhouse+0x19887261)
#32 void std::__1::__function::__policy_func<void ()>::__call_func[abi:fqe220101]<ThreadFromGlobalPoolImpl<false, true>::ThreadFromGlobalPoolImpl<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&&)::'lambda'()>(std::__1::__function::__policy_storage const*) contrib/llvm-project/libcxx/include/__functional/function.h:443:12 (clickhouse+0x19887261)
#33 std::__1::__function::__policy_func<void ()>::operator()[abi:fqe220101]() const contrib/llvm-project/libcxx/include/__functional/function.h:502:12 (clickhouse+0x1987802e) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#34 std::__1::function<void ()>::operator()() const contrib/llvm-project/libcxx/include/__functional/function.h:754:10 (clickhouse+0x1987802e)
#35 startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0::operator()() src/Common/ThreadPool.cpp:961:13 (clickhouse+0x1987802e)
#36 std::__1::__invoke_result_impl<void, startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&>::type std::__1::__invoke[abi:fqe220101]<startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&>(startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:90:27 (clickhouse+0x1987802e)
#37 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:fqe220101]<startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&>(startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:350:5 (clickhouse+0x1987802e)
#38 void std::__1::__invoke_r[abi:fqe220101]<void, startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&>(startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h:356:10 (clickhouse+0x1987802e)
#39 void std::__1::__function::__policy_func<void ()>::__call_func[abi:fqe220101]<startThreadFromGlobalPool(std::__1::shared_ptr<ThreadFromGlobalPoolState>, std::__1::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0>(std::__1::__function::__policy_storage const*) contrib/llvm-project/libcxx/include/__functional/function.h:443:12 (clickhouse+0x1987802e)
#40 std::__1::__function::__policy_func<void ()>::operator()[abi:fqe220101]() const contrib/llvm-project/libcxx/include/__functional/function.h:502:12 (clickhouse+0x19879497) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#41 std::__1::function<void ()>::operator()() const contrib/llvm-project/libcxx/include/__functional/function.h:754:10 (clickhouse+0x19879497)
#42 ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::worker() src/Common/ThreadPool.cpp:812:17 (clickhouse+0x19879497)
#43 std::__1::__invoke_result_impl<void, void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*>::type std::__1::__invoke[abi:fqe220101]<void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*>(void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*&&) contrib/llvm-project/libcxx/include/__type_traits/invoke.h (clickhouse+0x19883adb) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba)
#44 void std::__1::__thread_execute[abi:fqe220101]<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*, 0ul, 1ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*>&, std::__1::__integer_sequence<unsigned long, 0ul, 1ul>) contrib/llvm-project/libcxx/include/__thread/thread.h:161:3 (clickhouse+0x19883adb)
#45 void* std::__1::__thread_proxy[abi:fqe220101]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*>>(void*) contrib/llvm-project/libcxx/include/__thread/thread.h:169:3 (clickhouse+0x19883adb)
SUMMARY: ThreadSanitizer: data race (/home/ubuntu/actions-runner/_work/ClickHouse/ClickHouse/ci/tmp/clickhouse+0xc918d0f) (BuildId: 942f38edfc5be57733cee644cd766de03fa457ba) in __tsan_memcpy
Version info
- Resolved by: Revert "Revert "Make getServerSetting return live values for runtime-changeable settings"" #107388
- Merged into:
26.6.1.770
Activity
Algunenano commentedon Jun 10, 2026
Introduced in #105172. Let's revert
Fix data race on ServerSettings exposed by getServerSetting