msgr: queue reset when marking down pipes on shutdown

This lets the callbacks clean up ref cycles.

Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2013-06-12 17:58:36 -07:00
parent ea6880f8a2
commit 597e4398b5

View File

@ -83,8 +83,8 @@ void SimpleMessenger::ready()
int SimpleMessenger::shutdown()
{
ldout(cct,10) << "shutdown " << get_myaddr() << dendl;
dispatch_queue.shutdown();
mark_down_all();
dispatch_queue.shutdown();
return 0;
}
@ -562,7 +562,10 @@ void SimpleMessenger::mark_down_all()
p->unregister_pipe();
p->pipe_lock.Lock();
p->stop();
ConnectionRef con = p->connection_state;
p->pipe_lock.Unlock();
if (con && con->clear_pipe(p))
dispatch_queue.queue_reset(con.get());
}
lock.Unlock();
}