From: Sage Weil Date: Fri, 19 Jul 2019 20:59:10 +0000 (-0500) Subject: osd: add mono_timer X-Git-Tag: v15.1.0~1379^2~25 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5b5aa8b0c8f42a5de930ee21cdadd45ae98b553f;p=ceph.git osd: add mono_timer Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 96aed0b706e3..6f5ca81ba0ae 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -481,6 +481,8 @@ void OSDService::shutdown_reserver() void OSDService::shutdown() { + mono_timer.suspend(); + { std::lock_guard l(watch_lock); watch_timer.shutdown(); @@ -509,6 +511,7 @@ void OSDService::init() watch_timer.init(); agent_timer.init(); + mono_timer.resume(); agent_thread.create("osd_srv_agent"); diff --git a/src/osd/OSD.h b/src/osd/OSD.h index ae2fafd201fb..3d7c70e68455 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -25,6 +25,7 @@ #include "common/ceph_context.h" #include "common/config_cacher.h" #include "common/zipkin_trace.h" +#include "common/ceph_timer.h" #include "mgr/MgrClient.h" @@ -857,6 +858,10 @@ public: /// get or create a ref for a peer's HeartbeatStamps HeartbeatStampsRef get_hb_stamps(unsigned osd); + + // Timer for readable leases + ceph::timer mono_timer = ceph::timer{ceph::construct_suspended}; + // -- stopping -- ceph::mutex is_stopping_lock = ceph::make_mutex("OSDService::is_stopping_lock"); ceph::condition_variable is_stopping_cond;