mirror of
https://github.com/ceph/ceph
synced 2025-01-19 01:21:49 +00:00
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:
parent
6aba942170
commit
11cefcab23
@ -2358,7 +2358,7 @@ int OSD::shutdown()
|
||||
|
||||
service.start_shutdown();
|
||||
|
||||
dispatch_sessions_waiting_on_map();
|
||||
clear_waiting_sessions();
|
||||
|
||||
// Shutdown PGs
|
||||
{
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user