From: Sage Weil Date: Fri, 9 May 2014 15:41:33 +0000 (-0700) Subject: osd: cancel agent_timer events on shutdown X-Git-Tag: v0.83~21^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2085%2Fhead;p=ceph.git osd: cancel agent_timer events on shutdown We need to cancel all agent timer events on shutdown. This also needs to happen early so that any in-progress events will execute before we start flushing and cleaning up PGs. Backport: firefly Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 597678722e6a..84fe1148b816 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -426,6 +426,15 @@ void OSDService::pg_stat_queue_dequeue(PG *pg) osd->pg_stat_queue_dequeue(pg); } +void OSDService::start_shutdown() +{ + { + Mutex::Locker l(agent_timer_lock); + agent_timer.cancel_all_events(); + agent_timer.shutdown(); + } +} + void OSDService::shutdown() { reserver_finisher.stop(); @@ -446,10 +455,6 @@ void OSDService::shutdown() Mutex::Locker l(backfill_request_lock); backfill_request_timer.shutdown(); } - { - Mutex::Locker l(agent_timer_lock); - agent_timer.shutdown(); - } osdmap = OSDMapRef(); next_osdmap = OSDMapRef(); } @@ -1627,6 +1632,8 @@ int OSD::shutdown() cct->_conf->set_val("debug_ms", "100"); cct->_conf->apply_changes(NULL); + service.start_shutdown(); + dispatch_sessions_waiting_on_map(); // Shutdown PGs diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 1926b42d74a9..13f773bd3890 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -759,6 +759,7 @@ public: void pg_stat_queue_dequeue(PG *pg); void init(); + void start_shutdown(); void shutdown(); // split