]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonClient: discard stray messages from non-acitve conns
authorKefu Chai <kchai@redhat.com>
Sun, 26 Feb 2017 16:18:09 +0000 (00:18 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 26 Feb 2017 16:23:07 +0000 (00:23 +0800)
Fixes: http://tracker.ceph.com/issues/19015
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/MonClient.cc

index 5bf131af69480ac15481cbb7c234756d397abdcb..644a0e48812bf024a5be2699d1ea507fc4f43d81 100644 (file)
@@ -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();