mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +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_file = msg.getSourceFile();
|
||||||
|
|
||||||
elem.source_line = msg.getSourceLine();
|
elem.source_line = msg.getSourceLine();
|
||||||
|
std::shared_ptr<TextLog> text_log_locked{};
|
||||||
std::lock_guard<std::mutex> lock(text_log_mutex);
|
{
|
||||||
if (auto log = text_log.lock())
|
std::lock_guard<std::mutex> lock(text_log_mutex);
|
||||||
log->add(elem);
|
text_log_locked = text_log.lock();
|
||||||
|
}
|
||||||
|
if (text_log_locked)
|
||||||
|
text_log_locked->add(elem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user