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>
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();
}
}