]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "msg/async: do not trigger RESETSESSION from connect fault during connection... 30991/head
authorNathan Cutler <ncutler@suse.com>
Fri, 18 Oct 2019 10:31:14 +0000 (12:31 +0200)
committerNathan Cutler <ncutler@suse.com>
Fri, 18 Oct 2019 10:31:14 +0000 (12:31 +0200)
This reverts commit 00b163564c6cafd4edf54d470cc708eab9dae10e.

Xie Xingguo and Ricardo Dias looked at this, and both agreed that the bug
was caused with the reduction of states of the V1 protocol during its
refactoring. In other words, the bug is not present in mimic.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
src/msg/async/AsyncConnection.cc

index d196c00c6ddc468de917c6163728327a09b9daf7..3621b125b611095ee060096f4785b61cf4767fa4 100644 (file)
@@ -2118,9 +2118,20 @@ void AsyncConnection::fault()
   }
 
   write_lock.unlock();
-  if ((state >= STATE_CONNECTING && state <= STATE_CONNECTING_SEND_CONNECT_MSG) ||
-      state == STATE_WAIT) {
-    // backoff!
+  if (!(state >= STATE_CONNECTING && state < STATE_CONNECTING_READY) &&
+      state != STATE_WAIT) { // STATE_WAIT is coming from STATE_CONNECTING_*
+    // policy maybe empty when state is in accept
+    if (policy.server) {
+      ldout(async_msgr->cct, 0) << __func__ << " server, going to standby" << dendl;
+      state = STATE_STANDBY;
+    } else {
+      ldout(async_msgr->cct, 0) << __func__ << " initiating reconnect" << dendl;
+      connect_seq++;
+      state = STATE_CONNECTING;
+    }
+    backoff = utime_t();
+    center->dispatch_event_external(read_handler);
+  } else {
     if (state == STATE_WAIT) {
       backoff.set_from_double(async_msgr->cct->_conf->ms_max_backoff);
     } else if (backoff == utime_t()) {
@@ -2136,18 +2147,6 @@ void AsyncConnection::fault()
     // woke up again;
     register_time_events.insert(center->create_time_event(
             backoff.to_nsec()/1000, wakeup_handler));
-  } else {
-     // policy maybe empty when state is in accept
-    if (policy.server) {
-      ldout(async_msgr->cct, 0) << __func__ << " server, going to standby" << dendl;
-      state = STATE_STANDBY;
-    } else {
-      ldout(async_msgr->cct, 0) << __func__ << " initiating reconnect" << dendl;
-      connect_seq++;
-      state = STATE_CONNECTING;
-    }
-    backoff = utime_t();
-    center->dispatch_event_external(read_handler);
   }
 }