From c0f160066671e80e0d1c33fa2fe2894dd653e510 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 27 Feb 2017 00:18:09 +0800 Subject: [PATCH] mon/MonClient: discard stray messages from non-acitve conns Fixes: http://tracker.ceph.com/issues/19015 Signed-off-by: Kefu Chai --- src/mon/MonClient.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index 5bf131af69480..644a0e48812bf 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -249,7 +249,9 @@ bool MonClient::ms_dispatch(Message *m) Mutex::Locker lock(monc_lock); if (_hunting()) { - if (!pending_cons.count(m->get_source_addr())) { + auto pending_con = pending_cons.find(m->get_source_addr()); + if (pending_con == pending_cons.end() || + pending_con->second.get_con() != m->get_connection()) { // ignore any messages outside hunting sessions ldout(cct, 10) << "discarding stray monitor message " << *m << dendl; m->put(); -- 2.39.5