]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: drop any ops from closed sessions in dispatch_op
authorSage Weil <sage@redhat.com>
Tue, 29 Sep 2015 12:50:16 +0000 (08:50 -0400)
committerSage Weil <sage@redhat.com>
Mon, 5 Oct 2015 12:37:49 +0000 (08:37 -0400)
If we've closed the session we shouldn't waste our time on this op.

Fixes: #13262 (we should not add a subscription to a disconnected session)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/Monitor.cc

index e7fb12c5edec7dbc9155316aab82082b94938fff..4c31b44aa9574bf0ecde798d16cdc8d884ed10b5 100644 (file)
@@ -3503,6 +3503,13 @@ void Monitor::_ms_dispatch(Message *m)
 void Monitor::dispatch_op(MonOpRequestRef op)
 {
   op->mark_event("mon:dispatch_op");
+  MonSession *s = op->get_session();
+  assert(s);
+  if (s->closed) {
+    dout(10) << " session closed, dropping " << op->get_req() << dendl;
+    return;
+  }
+
   /* we will consider the default type as being 'monitor' until proven wrong */
   op->set_type_monitor();
   /* deal with all messages that do not necessarily need caps */