mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Fix exception fix in TraceCollector dtor
Cf. #44758 Function try blocks in ctors/dtors implicitly rethrow, making them more or less useless. https://www.onlinegdb.com/pCKQA0wTIN (click RUN) https://stackoverflow.com/questions/5612486/when-is-a-function-try-block-useful/5612508#5612508 Fortunately, this seems the only place like that in the codebase.
This commit is contained in:
parent
078f4d947a
commit
9ef7dac0b5
@ -31,18 +31,20 @@ TraceCollector::TraceCollector(std::shared_ptr<TraceLog> trace_log_)
|
||||
|
||||
|
||||
TraceCollector::~TraceCollector()
|
||||
try
|
||||
{
|
||||
if (!thread.joinable())
|
||||
LOG_ERROR(&Poco::Logger::get("TraceCollector"), "TraceCollector thread is malformed and cannot be joined");
|
||||
else
|
||||
stop();
|
||||
try
|
||||
{
|
||||
if (!thread.joinable())
|
||||
LOG_ERROR(&Poco::Logger::get("TraceCollector"), "TraceCollector thread is malformed and cannot be joined");
|
||||
else
|
||||
stop();
|
||||
|
||||
TraceSender::pipe.close();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
tryLogCurrentException("TraceCollector");
|
||||
TraceSender::pipe.close();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
tryLogCurrentException("TraceCollector");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user