Remove extra try/catch for QueryState reset

It was possible back when destuctors may throw, in a pre C++11.

I've found one place where it may throw from 2012:

    ~UnionBlockInputStream()
    {
        ...
        if (exception && !std::uncaught_exception())
            exception->rethrow();
        ...
    }

Refs: 8a053aba54
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2023-02-18 10:54:22 +01:00
parent f9cd66db36
commit 6f7b6e9206

View File

@ -601,23 +601,12 @@ void TCPHandler::runImpl()
LOG_DEBUG(log, "Processed in {} sec.", state.watch.elapsedSeconds());
}
try
{
/// QueryState should be cleared before QueryScope, since otherwise
/// the MemoryTracker will be wrong for possible deallocations.
/// (i.e. deallocations from the Aggregator with two-level aggregation)
state.reset();
query_scope.reset();
thread_trace_context.reset();
}
catch (...)
{
/** During the processing of request, there was an exception that we caught and possibly sent to client.
* When destroying the request pipeline execution there was a second exception.
* For example, a pipeline could run in multiple threads, and an exception could occur in each of them.
* Ignore it.
*/
}
/// QueryState should be cleared before QueryScope, since otherwise
/// the MemoryTracker will be wrong for possible deallocations.
/// (i.e. deallocations from the Aggregator with two-level aggregation)
state.reset();
query_scope.reset();
thread_trace_context.reset();
/// It is important to destroy query context here. We do not want it to live arbitrarily longer than the query.
query_context.reset();