```
select 1 from remote('127.0.0.2', system, one)

select query, query_id, initial_query_id from system.query_log where initial_query_id = '526f714d-41d1-4ac2-8a97-60d7f268cdf4' and type = 2;


┌─query──────────────────────────────────────────┬─query_id─────────────────────────────┬─initial_query_id─────────────────────┐
│ DESC TABLE system.one                          │ 380d45f1-166f-46f8-99e7-a04324b5650d │ 526f714d-41d1-4ac2-8a97-60d7f268cdf4 │
│ DESC TABLE system.one                          │ b564f6c3-e929-4ae8-a5c4-7f617a12ebb4 │ 526f714d-41d1-4ac2-8a97-60d7f268cdf4 │
│ SELECT 1 FROM system.one                       │ 5318008e-a669-4d0c-9d3c-8f270ea437a1 │ 526f714d-41d1-4ac2-8a97-60d7f268cdf4 │
│ select 1 from remote('127.0.0.2', system, one) │ 526f714d-41d1-4ac2-8a97-60d7f268cdf4 │ 526f714d-41d1-4ac2-8a97-60d7f268cdf4 │
└────────────────────────────────────────────────┴──────────────────────────────────────┴──────────────────────────────────────┘
```

You can see that the `DESC TABLE` query for the `127.0.0.2` shard is performed twice, not once. I think this should be considered a bug, because the second query is unnecessary, and it leads to a latency increase, at least by one roundtrip. This is not good enough for our primary method of running distributed queries.

Adding additional logging to `Connection::sendQuery`, I could get the stack traces where each query is sent:
```
2020.08.28 23:22:43.225922 [ 1022234 ] {83daa89d-61ef-4952-ad30-44a6bdd36e53} <Trace> Connection (127.0.0.2:9000): Connected to ClickHouse server version 20.8.1.
2020.08.28 23:22:43.297851 [ 1022234 ] {83daa89d-61ef-4952-ad30-44a6bdd36e53} <Information> : Send query 'DESC TABLE system.one' at 
0. /home/akuzm/ch2/ch/src/Common/StackTrace.cpp:291: StackTrace::tryCapture() @ 0x33830a in /home/akuzm/ch2/build-clang10/src/libclickhouse_common_iod.so
1. /home/akuzm/ch2/ch/src/Common/StackTrace.cpp:256: StackTrace::StackTrace() @ 0x3382c5 in /home/akuzm/ch2/build-clang10/src/libclickhouse_common_iod.so
2. /home/akuzm/ch2/ch/src/Client/Connection.cpp:365: DB::Connection::sendQuery(DB::ConnectionTimeouts const&, 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&, unsigned long, DB::Settings const*, DB::ClientInfo const*, bool) @ 0x16d669 in /home/akuzm/ch2/build-clang10/src/libclickhouse_clientd.so
3. /home/akuzm/ch2/ch/src/Client/MultiplexedConnections.cpp:135: DB::MultiplexedConnections::sendQuery(DB::ConnectionTimeouts const&, 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&, unsigned long, DB::ClientInfo const&, bool) @ 0x1dd657 in /home/akuzm/ch2/build-clang10/src/libclickhouse_clientd.so
4. /home/akuzm/ch2/ch/src/DataStreams/RemoteQueryExecutor.cpp:159: DB::RemoteQueryExecutor::sendQuery() @ 0x35d411 in /home/akuzm/ch2/build-clang10/src/libclickhouse_datastreamsd.so
5. /home/akuzm/ch2/ch/src/DataStreams/RemoteBlockInputStream.cpp:44: DB::RemoteBlockInputStream::readPrefix() @ 0x35710e in /home/akuzm/ch2/build-clang10/src/libclickhouse_datastreamsd.so
6. /home/akuzm/ch2/ch/src/Storages/getStructureOfRemoteTable.cpp:115: DB::getStructureOfRemoteTableInShard(DB::Cluster::ShardInfo const&, DB::StorageID const&, DB::Context const&, std::__1::shared_ptr<DB::IAST> const&) @ 0xc56262 in /home/akuzm/ch2/build-clang10/src/libclickhouse_storagesd.so
7. /home/akuzm/ch2/ch/src/Storages/getStructureOfRemoteTable.cpp:42: DB::getStructureOfRemoteTable(DB::Cluster const&, DB::StorageID const&, DB::Context const&, std::__1::shared_ptr<DB::IAST> const&) @ 0xc552a1 in /home/akuzm/ch2/build-clang10/src/libclickhouse_storagesd.so
8. /home/akuzm/ch2/ch/src/TableFunctions/TableFunctionRemote.cpp:195: DB::TableFunctionRemote::executeImpl(std::__1::shared_ptr<DB::IAST> const&, DB::Context const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const @ 0x207788 in /home/akuzm/ch2/build-clang10/src/TableFunctions/libclickhouse_table_functionsd.so
9. /home/akuzm/ch2/ch/src/TableFunctions/ITableFunction.cpp:20: DB::ITableFunction::execute(std::__1::shared_ptr<DB::IAST> const&, DB::Context const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const @ 0x534571 in /home/akuzm/ch2/build-clang10/src/libdbmsd.so
10. /home/akuzm/ch2/ch/src/Interpreters/Context.cpp:922: DB::Context::executeTableFunction(std::__1::shared_ptr<DB::IAST> const&) @ 0x12f1971 in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
11. /home/akuzm/ch2/ch/src/Interpreters/JoinedTables.cpp:162: DB::JoinedTables::getLeftTableStorage() @ 0x193061d in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
12. /home/akuzm/ch2/ch/src/Interpreters/InterpreterSelectQuery.cpp:257: DB::InterpreterSelectQuery::InterpreterSelectQuery(std::__1::shared_ptr<DB::IAST> const&, DB::Context const&, std::__1::shared_ptr<DB::IBlockInputStream> const&, std::__1::optional<DB::Pipe>, std::__1::shared_ptr<DB::IStorage> 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&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&) @ 0x185752a in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
13. /home/akuzm/ch2/ch/src/Interpreters/InterpreterSelectQuery.cpp:147: DB::InterpreterSelectQuery::InterpreterSelectQuery(std::__1::shared_ptr<DB::IAST> const&, DB::Context 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&) @ 0x1856d4c in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
14. /home/akuzm/ch2/ch/contrib/libcxx/include/memory:3028: std::__1::__unique_if<DB::InterpreterSelectQuery>::__unique_single std::__1::make_unique<DB::InterpreterSelectQuery, std::__1::shared_ptr<DB::IAST>&, DB::Context&, DB::SelectQueryOptions&, 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::shared_ptr<DB::IAST>&, DB::Context&, DB::SelectQueryOptions&, 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&) @ 0x18d2381 in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
15. /home/akuzm/ch2/ch/src/Interpreters/InterpreterSelectWithUnionQuery.cpp:84: DB::InterpreterSelectWithUnionQuery::InterpreterSelectWithUnionQuery(std::__1::shared_ptr<DB::IAST> const&, DB::Context 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&) @ 0x18d0e8a in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
16. /home/akuzm/ch2/ch/contrib/libcxx/include/memory:3028: std::__1::__unique_if<DB::InterpreterSelectWithUnionQuery>::__unique_single std::__1::make_unique<DB::InterpreterSelectWithUnionQuery, std::__1::shared_ptr<DB::IAST>&, DB::Context&, DB::SelectQueryOptions>(std::__1::shared_ptr<DB::IAST>&, DB::Context&, DB::SelectQueryOptions&&) @ 0x18136e5 in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
17. /home/akuzm/ch2/ch/src/Interpreters/InterpreterFactory.cpp:107: DB::InterpreterFactory::get(std::__1::shared_ptr<DB::IAST>&, DB::Context&, DB::QueryProcessingStage::Enum) @ 0x1812673 in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
18. /home/akuzm/ch2/ch/src/Interpreters/executeQuery.cpp:407: DB::executeQueryImpl(char const*, char const*, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool, DB::ReadBuffer*) @ 0x1c88c21 in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
19. /home/akuzm/ch2/ch/src/Interpreters/executeQuery.cpp:742: DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool) @ 0x1c87e4a in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
20. /home/akuzm/ch2/ch/src/Server/TCPHandler.cpp:253: DB::TCPHandler::runImpl() @ 0x3755a4 in /home/akuzm/ch2/build-clang10/src/libclickhouse_serverd.so
21. /home/akuzm/ch2/ch/src/Server/TCPHandler.cpp:1217: DB::TCPHandler::run() @ 0x37cad8 in /home/akuzm/ch2/build-clang10/src/libclickhouse_serverd.so
22. /home/akuzm/ch2/ch/contrib/poco/Net/src/TCPServerConnection.cpp:43: Poco::Net::TCPServerConnection::start() @ 0x1b9d7c in /home/akuzm/ch2/build-clang10/contrib/poco-cmake/Net/lib_poco_netd.so
23. /home/akuzm/ch2/ch/contrib/poco/Net/src/TCPServerDispatcher.cpp:114: Poco::Net::TCPServerDispatcher::run() @ 0x1ba58a in /home/akuzm/ch2/build-clang10/contrib/poco-cmake/Net/lib_poco_netd.so
24. /home/akuzm/ch2/ch/contrib/poco/Foundation/src/ThreadPool.cpp:199: Poco::PooledThread::run() @ 0x276173 in /home/akuzm/ch2/build-clang10/contrib/poco-cmake/Foundation/lib_poco_foundationd.so
25. /home/akuzm/ch2/ch/contrib/poco/Foundation/src/Thread.cpp:56: Poco::(anonymous namespace)::RunnableHolder::run() @ 0x27303d in /home/akuzm/ch2/build-clang10/contrib/poco-cmake/Foundation/lib_poco_foundationd.so
26. /home/akuzm/ch2/ch/contrib/poco/Foundation/src/Thread_POSIX.cpp:345: Poco::ThreadImpl::runnableEntry(void*) @ 0x271eba in /home/akuzm/ch2/build-clang10/contrib/poco-cmake/Foundation/lib_poco_foundationd.so
27. start_thread @ 0x9609 in /lib/x86_64-linux-gnu/libpthread-2.31.so
28. /build/glibc-YYA7BZ/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:97: clone @ 0x122103 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so



2020.08.28 23:22:43.307252 [ 1022234 ] {83daa89d-61ef-4952-ad30-44a6bdd36e53} <Trace> Connection (127.0.0.2:9000): Connected to ClickHouse server version 20.8.1.
2020.08.28 23:22:43.385436 [ 1022234 ] {83daa89d-61ef-4952-ad30-44a6bdd36e53} <Information> : Send query 'DESC TABLE system.one' at 
0. /home/akuzm/ch2/ch/src/Common/StackTrace.cpp:291: StackTrace::tryCapture() @ 0x33830a in /home/akuzm/ch2/build-clang10/src/libclickhouse_common_iod.so
1. /home/akuzm/ch2/ch/src/Common/StackTrace.cpp:256: StackTrace::StackTrace() @ 0x3382c5 in /home/akuzm/ch2/build-clang10/src/libclickhouse_common_iod.so
2. /home/akuzm/ch2/ch/src/Client/Connection.cpp:365: DB::Connection::sendQuery(DB::ConnectionTimeouts const&, 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&, unsigned long, DB::Settings const*, DB::ClientInfo const*, bool) @ 0x16d669 in /home/akuzm/ch2/build-clang10/src/libclickhouse_clientd.so
3. /home/akuzm/ch2/ch/src/Client/MultiplexedConnections.cpp:135: DB::MultiplexedConnections::sendQuery(DB::ConnectionTimeouts const&, 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&, unsigned long, DB::ClientInfo const&, bool) @ 0x1dd657 in /home/akuzm/ch2/build-clang10/src/libclickhouse_clientd.so
4. /home/akuzm/ch2/ch/src/DataStreams/RemoteQueryExecutor.cpp:159: DB::RemoteQueryExecutor::sendQuery() @ 0x35d411 in /home/akuzm/ch2/build-clang10/src/libclickhouse_datastreamsd.so
5. /home/akuzm/ch2/ch/src/DataStreams/RemoteBlockInputStream.cpp:44: DB::RemoteBlockInputStream::readPrefix() @ 0x35710e in /home/akuzm/ch2/build-clang10/src/libclickhouse_datastreamsd.so
6. /home/akuzm/ch2/ch/src/Storages/getStructureOfRemoteTable.cpp:115: DB::getStructureOfRemoteTableInShard(DB::Cluster::ShardInfo const&, DB::StorageID const&, DB::Context const&, std::__1::shared_ptr<DB::IAST> const&) @ 0xc56262 in /home/akuzm/ch2/build-clang10/src/libclickhouse_storagesd.so
7. /home/akuzm/ch2/ch/src/Storages/getStructureOfRemoteTable.cpp:42: DB::getStructureOfRemoteTable(DB::Cluster const&, DB::StorageID const&, DB::Context const&, std::__1::shared_ptr<DB::IAST> const&) @ 0xc552a1 in /home/akuzm/ch2/build-clang10/src/libclickhouse_storagesd.so
8. /home/akuzm/ch2/ch/src/TableFunctions/TableFunctionRemote.cpp:195: DB::TableFunctionRemote::executeImpl(std::__1::shared_ptr<DB::IAST> const&, DB::Context const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const @ 0x207788 in /home/akuzm/ch2/build-clang10/src/TableFunctions/libclickhouse_table_functionsd.so
9. /home/akuzm/ch2/ch/src/TableFunctions/ITableFunction.cpp:20: DB::ITableFunction::execute(std::__1::shared_ptr<DB::IAST> const&, DB::Context const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const @ 0x534571 in /home/akuzm/ch2/build-clang10/src/libdbmsd.so
10. /home/akuzm/ch2/ch/src/Interpreters/Context.cpp:922: DB::Context::executeTableFunction(std::__1::shared_ptr<DB::IAST> const&) @ 0x12f1971 in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
11. /home/akuzm/ch2/ch/src/Interpreters/getTableExpressions.cpp:89: DB::getColumnsFromTableExpression(DB::ASTTableExpression const&, DB::Context const&, DB::NamesAndTypesList&, DB::NamesAndTypesList&, DB::NamesAndTypesList&) @ 0x1ca56cc in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
12. /home/akuzm/ch2/ch/src/Interpreters/getTableExpressions.cpp:133: DB::getDatabaseAndTablesWithColumns(std::__1::vector<DB::ASTTableExpression const*, std::__1::allocator<DB::ASTTableExpression const*> > const&, DB::Context const&) @ 0x1ca5ca9 in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
13. /home/akuzm/ch2/ch/src/Interpreters/JoinedTables.cpp:190: DB::JoinedTables::resolveTables() @ 0x1930a33 in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
14. /home/akuzm/ch2/ch/src/Interpreters/InterpreterSelectQuery.cpp:267: DB::InterpreterSelectQuery::InterpreterSelectQuery(std::__1::shared_ptr<DB::IAST> const&, DB::Context const&, std::__1::shared_ptr<DB::IBlockInputStream> const&, std::__1::optional<DB::Pipe>, std::__1::shared_ptr<DB::IStorage> 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&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&) @ 0x18577be in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
15. /home/akuzm/ch2/ch/src/Interpreters/InterpreterSelectQuery.cpp:147: DB::InterpreterSelectQuery::InterpreterSelectQuery(std::__1::shared_ptr<DB::IAST> const&, DB::Context 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&) @ 0x1856d4c in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
16. /home/akuzm/ch2/ch/contrib/libcxx/include/memory:3028: std::__1::__unique_if<DB::InterpreterSelectQuery>::__unique_single std::__1::make_unique<DB::InterpreterSelectQuery, std::__1::shared_ptr<DB::IAST>&, DB::Context&, DB::SelectQueryOptions&, 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::shared_ptr<DB::IAST>&, DB::Context&, DB::SelectQueryOptions&, 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&) @ 0x18d2381 in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
17. /home/akuzm/ch2/ch/src/Interpreters/InterpreterSelectWithUnionQuery.cpp:84: DB::InterpreterSelectWithUnionQuery::InterpreterSelectWithUnionQuery(std::__1::shared_ptr<DB::IAST> const&, DB::Context 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&) @ 0x18d0e8a in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
18. /home/akuzm/ch2/ch/contrib/libcxx/include/memory:3028: std::__1::__unique_if<DB::InterpreterSelectWithUnionQuery>::__unique_single std::__1::make_unique<DB::InterpreterSelectWithUnionQuery, std::__1::shared_ptr<DB::IAST>&, DB::Context&, DB::SelectQueryOptions>(std::__1::shared_ptr<DB::IAST>&, DB::Context&, DB::SelectQueryOptions&&) @ 0x18136e5 in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
19. /home/akuzm/ch2/ch/src/Interpreters/InterpreterFactory.cpp:107: DB::InterpreterFactory::get(std::__1::shared_ptr<DB::IAST>&, DB::Context&, DB::QueryProcessingStage::Enum) @ 0x1812673 in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
20. /home/akuzm/ch2/ch/src/Interpreters/executeQuery.cpp:407: DB::executeQueryImpl(char const*, char const*, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool, DB::ReadBuffer*) @ 0x1c88c21 in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
21. /home/akuzm/ch2/ch/src/Interpreters/executeQuery.cpp:742: DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool) @ 0x1c87e4a in /home/akuzm/ch2/build-clang10/src/libclickhouse_interpretersd.so
22. /home/akuzm/ch2/ch/src/Server/TCPHandler.cpp:253: DB::TCPHandler::runImpl() @ 0x3755a4 in /home/akuzm/ch2/build-clang10/src/libclickhouse_serverd.so
23. /home/akuzm/ch2/ch/src/Server/TCPHandler.cpp:1217: DB::TCPHandler::run() @ 0x37cad8 in /home/akuzm/ch2/build-clang10/src/libclickhouse_serverd.so
24. /home/akuzm/ch2/ch/contrib/poco/Net/src/TCPServerConnection.cpp:43: Poco::Net::TCPServerConnection::start() @ 0x1b9d7c in /home/akuzm/ch2/build-clang10/contrib/poco-cmake/Net/lib_poco_netd.so
25. /home/akuzm/ch2/ch/contrib/poco/Net/src/TCPServerDispatcher.cpp:114: Poco::Net::TCPServerDispatcher::run() @ 0x1ba58a in /home/akuzm/ch2/build-clang10/contrib/poco-cmake/Net/lib_poco_netd.so
26. /home/akuzm/ch2/ch/contrib/poco/Foundation/src/ThreadPool.cpp:199: Poco::PooledThread::run() @ 0x276173 in /home/akuzm/ch2/build-clang10/contrib/poco-cmake/Foundation/lib_poco_foundationd.so
27. /home/akuzm/ch2/ch/contrib/poco/Foundation/src/Thread.cpp:56: Poco::(anonymous namespace)::RunnableHolder::run() @ 0x27303d in /home/akuzm/ch2/build-clang10/contrib/poco-cmake/Foundation/lib_poco_foundationd.so
28. /home/akuzm/ch2/ch/contrib/poco/Foundation/src/Thread_POSIX.cpp:345: Poco::ThreadImpl::runnableEntry(void*) @ 0x271eba in /home/akuzm/ch2/build-clang10/contrib/poco-cmake/Foundation/lib_poco_foundationd.so
29. start_thread @ 0x9609 in /lib/x86_64-linux-gnu/libpthread-2.31.so
30. /build/glibc-YYA7BZ/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:97: clone @ 0x122103 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
```
external_user_defined_executable_functions_loader.reset();
            models_repository_guard.reset();
            external_models_loader.reset();
            buffer_flush_schedule_pool.reset();
            schedule_pool.reset();
            distributed_schedule_pool.reset();
            message_broker_schedule_pool.reset();
            ddl_worker.reset();
            access_control.reset();
            
            trace_collector.reset();
            
            zookeeper.reset();
        }
        
        delete_system_logs.reset();
    }
    bool hasTraceCollector() const
    {
        return trace_collector.has_value();
    }
    void initializeTraceCollector(std::shared_ptr<TraceLog> trace_log)
    {
        if (!trace_log)
            return;
        if (hasTraceCollector())
            return;
        trace_collector.emplace(std::move(trace_log));
    }
    void addWarningMessage(const String & message)