From 525830cd0bf9017fe65a52e5e62b483bbb6543b1 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 17 Jul 2012 15:30:11 -0700 Subject: [PATCH] msgr: do not discard_queue in Pipe reaper The IncomingQueue can live beyond the Pipe. In particular, there is no reason not to deliver messages we've received on this connection even though the socket has errored out. Separate incoming queue discard from outgoing, and only do the latter in the reaper. Signed-off-by: Sage Weil --- src/msg/Pipe.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/msg/Pipe.cc b/src/msg/Pipe.cc index ed38f5f141484..9d4dda2fbbed1 100644 --- a/src/msg/Pipe.cc +++ b/src/msg/Pipe.cc @@ -942,9 +942,6 @@ void Pipe::discard_queue() { ldout(msgr->cct,10) << "discard_queue" << dendl; - in_q->discard_queue(); - ldout(msgr->cct,20) << " dequeued pipe " << dendl; - for (list::iterator p = sent.begin(); p != sent.end(); p++) { if (*p < (void *) DispatchQueue::D_NUM_CODES) { continue; // skip non-Message dispatch codes @@ -1036,6 +1033,7 @@ void Pipe::fail() stop(); + in_q->discard_queue(); discard_queue(); msgr->dispatch_queue.queue_reset(connection_state); @@ -1046,6 +1044,7 @@ void Pipe::was_session_reset() assert(pipe_lock.is_locked()); ldout(msgr->cct,10) << "was_session_reset" << dendl; + in_q->discard_queue(); discard_queue(); msgr->dispatch_queue.queue_remote_reset(connection_state); -- 2.39.5