]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: clear out the delay queue when stop()ing
authorGreg Farnum <greg@inktank.com>
Tue, 27 Nov 2012 17:44:19 +0000 (09:44 -0800)
committerSage Weil <sage@inktank.com>
Fri, 30 Nov 2012 00:09:44 +0000 (16:09 -0800)
After some brief thought, I believe deleting any messages in the
delay queue is correct -- we are trying to simulate line delays
in delivery and so anything still in the queue has supposedly
not arrived yet. So delete them when we stop the Pipe for
any reason.

Signed-off-by: Greg Farnum <greg@inktank.com>
src/msg/Pipe.cc

index 104208c4379bd2bb36e2406211a9b74e02ebb455..e49658412c09f339948b035badbbe09e5fbb1163 100644 (file)
@@ -1197,6 +1197,10 @@ void Pipe::stop()
     lsubdout(msgr->cct, ms, 1) << "signalling to stop delayed dispatch thread and clear out messages" << dendl;
     Mutex::Locker locker(*delay_lock);
     stop_delayed_delivery = true;
+    while (!delay_queue->empty()) {
+      delay_queue->front()->put();
+      delay_queue->pop_front();
+    }
     delay_cond->Signal();
   }
 }