diff options
author | Greg Farnum <greg@inktank.com> | 2012-11-27 09:44:19 -0800 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-11-29 16:09:44 -0800 |
commit | 01059e9b430d2f0b248deed57f014d7c0d6c1d37 (patch) | |
tree | c867bd77fb4365f6420c61e92ce7e7b724875d0c | |
parent | 0e92f892047b907cb05ebfab11e121b21fa00813 (diff) | |
download | ceph-01059e9b430d2f0b248deed57f014d7c0d6c1d37.tar.gz |
msgr: clear out the delay queue when stop()ing
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>
-rw-r--r-- | src/msg/Pipe.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/msg/Pipe.cc b/src/msg/Pipe.cc index 104208c4379..e49658412c0 100644 --- a/src/msg/Pipe.cc +++ b/src/msg/Pipe.cc @@ -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(); } } |