]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon: ignore msg without session attached 8130/head
authorKefu Chai <kchai@redhat.com>
Tue, 15 Mar 2016 12:07:11 +0000 (20:07 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 17 Mar 2016 16:09:07 +0000 (00:09 +0800)
commitf8cca624d4c201f4317a2fa021ac71e518730644
treec4c527b1953161bd23c42914e1dd95126828f80a
parent809df6e112251060b94e6c724cbe5fcde3a19ff1
mon: ignore msg without session attached

there is chance that a connection gets reset, and the session attached
to a message that was sent over this connection is reset. i.e.
con->set_priv(NULL) in Monitor::ms_handle_reset(), but we are about to
handle_command() this message after the message is somehow requeued. so,
not all MonOpRequests have an attached Session, especially those are
re-dispatched. we could check conn->is_connected() everywhere, but
that's error-prone and hard to maintain. so, in this change:

* we need to check for the session before looking at it closer.
* hold a reference to it when holding it, because in another thread,
  ms_handle_reset() could be freeing it.

Fixes: #15113
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/Monitor.cc