]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
log: there is no need to flush the log buf 31243/head
authorXiubo Li <xiubli@redhat.com>
Sun, 3 Nov 2019 07:20:15 +0000 (12:50 +0530)
committerXiubo Li <xiubli@redhat.com>
Mon, 18 Nov 2019 00:34:21 +0000 (19:34 -0500)
The m_log_buf just a buffer for the log messages in _flush() before
flushing them to the log files and the buffer should already be
emptied by the _flush() routine. It makes no sense to flush the empty
buffer again here.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
src/log/Log.cc

index 10cc60bda1ac6e57dd6325808be37fc00a929691..6a1f40f51daccd57d4377d5ba5dd1ddacdbe0d9c 100644 (file)
@@ -345,7 +345,6 @@ void Log::dump_recent()
   }
 
   _flush(m_flush, false);
-  _flush_logbuf();
 
   _log_message("--- begin dump of recent events ---", true);
   {
@@ -375,7 +374,7 @@ void Log::dump_recent()
 
   _log_message("--- end dump of recent events ---", true);
 
-  _flush_logbuf();
+  assert(m_log_buf.empty());
 
   m_flush_mutex_holder = 0;
 }