OSD::shutdown: actually drop sessions waiting on map

There might be messages for which we still don't have the
map.  Dispatching waiting won't actually help.

Signed-off-by: Samuel Just <sam.just@inktank.com>
This commit is contained in:
Samuel Just 2014-08-04 15:31:06 -07:00
parent 6aba942170
commit 11cefcab23
2 changed files with 17 additions and 1 deletions

View File

@ -2358,7 +2358,7 @@ int OSD::shutdown()
service.start_shutdown();
dispatch_sessions_waiting_on_map();
clear_waiting_sessions();
// Shutdown PGs
{

View File

@ -1166,6 +1166,22 @@ public:
Mutex session_waiting_lock;
set<Session*> session_waiting_for_map;
void clear_waiting_sessions() {
Mutex::Locker l(session_waiting_lock);
for (map<spg_t, set<Session*> >::iterator i =
session_waiting_for_pg.begin();
i != session_waiting_for_pg.end();
++i) {
for (set<Session*>::iterator j = i->second.begin();
j != i->second.end();
++j) {
(*j)->put();
}
}
session_waiting_for_pg.clear();
}
/// Caller assumes refs for included Sessions
void get_sessions_waiting_for_map(set<Session*> *out) {
Mutex::Locker l(session_waiting_lock);