mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 11:02:08 +00:00
Merge pull request #13386 from nikitamikhaylov/text-log-fix-2
Deadlock in textlog
This commit is contained in:
commit
f6fe0b9a19
@ -91,10 +91,13 @@ void OwnSplitChannel::logSplit(const Poco::Message & msg)
|
||||
elem.source_file = msg.getSourceFile();
|
||||
|
||||
elem.source_line = msg.getSourceLine();
|
||||
|
||||
std::lock_guard<std::mutex> lock(text_log_mutex);
|
||||
if (auto log = text_log.lock())
|
||||
log->add(elem);
|
||||
std::shared_ptr<TextLog> text_log_locked{};
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(text_log_mutex);
|
||||
text_log_locked = text_log.lock();
|
||||
}
|
||||
if (text_log_locked)
|
||||
text_log_locked->add(elem);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user