Merge pull request #44758 from ClickHouse/fix-crash-in-trace-collector-dtor

Do not throw exceptions in ~TraceCollector.
This commit is contained in:
Alexey Milovidov 2022-12-31 16:48:39 +03:00 committed by GitHub
commit 969214ce9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,7 @@ TraceCollector::TraceCollector(std::shared_ptr<TraceLog> trace_log_)
TraceCollector::~TraceCollector() TraceCollector::~TraceCollector()
try
{ {
if (!thread.joinable()) if (!thread.joinable())
LOG_ERROR(&Poco::Logger::get("TraceCollector"), "TraceCollector thread is malformed and cannot be joined"); LOG_ERROR(&Poco::Logger::get("TraceCollector"), "TraceCollector thread is malformed and cannot be joined");
@ -39,6 +40,10 @@ TraceCollector::~TraceCollector()
TraceSender::pipe.close(); TraceSender::pipe.close();
} }
catch (...)
{
tryLogCurrentException("TraceCollector");
}
/** Sends TraceCollector stop message /** Sends TraceCollector stop message