]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async/ProtocolV2: do not bump connect_seq for fault during ACCEPTING_SESSION
authorSage Weil <sage@redhat.com>
Wed, 23 Jan 2019 23:54:00 +0000 (17:54 -0600)
committerRicardo Dias <rdias@suse.com>
Thu, 24 Jan 2019 07:17:41 +0000 (07:17 +0000)
If we have a connection race, and we lose, we may end up with outgoing
messages *and* be in ACCEPTING_SESSION.  If we then fault, we want to
leave connect_seq at 0 to avoid triggering a reset.

Signed-off-by: Sage Weil <sage@redhat.com>
src/msg/async/ProtocolV2.cc

index 0d542b35062f5fe865bc8199593ee5a412cea079..ec8e7e534b31b12ca3901319b3a9fec32dda64cf 100644 (file)
@@ -654,7 +654,10 @@ CtPtr ProtocolV2::_fault() {
 
   connection->write_lock.unlock();
 
-  if (state != START_CONNECT && state != CONNECTING && state != WAIT) {
+  if (state != START_CONNECT &&
+      state != CONNECTING &&
+      state != WAIT &&
+      state != ACCEPTING_SESSION /* due to connection race */) {
     // policy maybe empty when state is in accept
     if (connection->policy.server) {
       ldout(cct, 1) << __func__ << " server, going to standby" << dendl;