Update InternalProfileEventsQueue usage

This commit is contained in:
Dmitry Novik 2021-09-21 00:52:01 +03:00
parent c1f3e7e0bb
commit 3a0764634e
2 changed files with 7 additions and 6 deletions

View File

@ -395,11 +395,9 @@ std::optional<Block> RemoteQueryExecutor::processPacket(Packet packet)
case Protocol::Server::ProfileEvents:
/// Pass profile events from remote server to client
{
auto profile_queue = CurrentThread::getInternalProfileEventsQueue();
if (auto profile_queue = CurrentThread::getInternalProfileEventsQueue())
profile_queue->emplace(std::move(packet.block));
break;
}
break;
default:
got_unknown_packet_from_replica = true;

View File

@ -246,8 +246,11 @@ void TCPHandler::runImpl()
sendLogs();
});
}
state.profile_queue = std::make_shared<InternalProfileEventsQueue>(std::numeric_limits<int>::max());
CurrentThread::attachInternalProfileEventsQueue(state.profile_queue);
if (client_tcp_protocol_version >= DBMS_MIN_PROTOCOL_VERSION_WITH_PROFILE_EVENTS)
{
state.profile_queue = std::make_shared<InternalProfileEventsQueue>(std::numeric_limits<int>::max());
CurrentThread::attachInternalProfileEventsQueue(state.profile_queue);
}
query_context->setExternalTablesInitializer([this] (ContextPtr context)
{