From: Sage Weil Date: Wed, 3 Apr 2019 19:54:55 +0000 (-0500) Subject: common/common_init: start log from common_init_finish (if not yet started) X-Git-Tag: v15.1.0~3009^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=30e49ae28b7a9cce6b489e1c866b35ac6ec8b70d;p=ceph.git common/common_init: start log from common_init_finish (if not yet started) This captures any non-global_init users who created their cct but haven't started up the log thread yet. As long as common_init_finish() happens after we have all of our config options (from the mon config or whatever), we will log (or not log) to the right location(s). Fixes a regression in cd6a5b9c40779956629803f222c365bdb291a169 Signed-off-by: Sage Weil --- diff --git a/src/common/common_init.cc b/src/common/common_init.cc index 9dd6be89b90c9..092804931be0b 100644 --- a/src/common/common_init.cc +++ b/src/common/common_init.cc @@ -106,6 +106,10 @@ void common_init_finish(CephContext *cct) cct->init_crypto(); ZTracer::ztrace_init(); + if (!cct->_log->is_started()) { + cct->_log->start(); + } + int flags = cct->get_init_flags(); if (!(flags & CINIT_FLAG_NO_DAEMON_ACTIONS)) cct->start_service_thread(); diff --git a/src/log/Log.h b/src/log/Log.h index ac10cf9047d95..a0b12e2743231 100644 --- a/src/log/Log.h +++ b/src/log/Log.h @@ -82,6 +82,8 @@ class Log : private Thread void _log_message(const char *s, bool crash); public: + using Thread::is_started; + Log(const SubsystemMap *s); ~Log() override;