From 7d42a648f0900535484f2eaffddf42e169b987d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Fri, 6 May 2016 11:47:13 +0200 Subject: [PATCH] logger: make sure the buffer is at least 300B larger than _min_write_chunk We always write larger chunks (orb messages) to the buffer, so the buffer needs to be larger than the minimum write chunk --- src/modules/logger/log_writer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/logger/log_writer.cpp b/src/modules/logger/log_writer.cpp index 5c96a9518a..7804195d48 100644 --- a/src/modules/logger/log_writer.cpp +++ b/src/modules/logger/log_writer.cpp @@ -12,7 +12,9 @@ constexpr size_t LogWriter::_min_write_chunk; LogWriter::LogWriter(size_t buffer_size) : - _buffer_size(math::max(buffer_size, _min_write_chunk)) + //We always write larger chunks (orb messages) to the buffer, so the buffer + //needs to be larger than the minimum write chunk (300 is somewhat arbitrary) + _buffer_size(math::max(buffer_size, _min_write_chunk + 300)) { pthread_mutex_init(&_mtx, nullptr); pthread_cond_init(&_cv, nullptr);