ElasticsearchWriter#Pause(): lock m_DataBufferMutex during Flush()

just to be sure regarding race conditions.
This commit is contained in:
Alexander Aleksandrovič Klimov 2023-06-30 14:57:18 +02:00 committed by GitHub
parent d5e6ecec8a
commit 076eb59443
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -119,7 +119,11 @@ void ElasticsearchWriter::Pause()
m_FlushTimer->Stop(true);
m_WorkQueue.Join();
Flush();
{
std::unique_lock<std::mutex> lock (m_DataBufferMutex);
Flush();
}
Log(LogInformation, "ElasticsearchWriter")
<< "'" << GetName() << "' paused.";