https://s3.amazonaws.com/clickhouse-test-reports/0/8ea7b9c9784f7014dccb4fe0dfd269265126a30d/stress_test__msan_.html

Post-processed traces: https://pastila.nl/?0006a09d/4a3864799d8b23c3998deeefcdca5d8f
Post-processed traces without boring threads: https://pastila.nl/?0006a09d/f342d95a823d513df62d68a5d8a1a50b

Explanation: https://pastila.nl/?000fcc82/3a48f372d3410a8691d50cb5647b2c20
{
    EntryPtr res;
    const ClientInfo & client_info = query_context->getClientInfo();
    const Settings & settings = query_context->getSettingsRef();
    if (client_info.current_query_id.empty())
        throw Exception("Query id cannot be empty", ErrorCodes::LOGICAL_ERROR);
    bool is_unlimited_query = isUnlimitedQuery(ast);
    {
        auto [lock, overcommit_blocker] = safeLock(); 
        IAST::QueryKind query_kind = ast->getQueryKind();
        const auto queue_max_wait_ms = settings.queue_max_wait_ms.totalMilliseconds();
        if (!is_unlimited_query && max_size && processes.size() >= max_size)
        {
            if (queue_max_wait_ms)
                LOG_WARNING(&Poco::Logger::get("ProcessList"), "Too many simultaneous queries, will wait {} ms.", queue_max_wait_ms);
            if (!queue_max_wait_ms || !have_space.wait_for(lock, std::chrono::milliseconds(queue_max_wait_ms), [&]{ return processes.size() < max_size; }))
                throw Exception("Too many simultaneous queries. Maximum: " + toString(max_size), ErrorCodes::TOO_MANY_SIMULTANEOUS_QUERIES);
        }
        if (!is_unlimited_query)
        {
            QueryAmount amount = getQueryKindAmount(query_kind);
            if (max_insert_queries_amount && query_kind == IAST::QueryKind::Insert && amount >= max_insert_queries_amount)
                throw Exception(ErrorCodes::TOO_MANY_SIMULTANEOUS_QUERIES,