]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
msg/async: msgr2: send keepalive on connection race winner
authorRicardo Dias <rdias@suse.com>
Tue, 15 Jan 2019 16:42:15 +0000 (16:42 +0000)
committerRicardo Dias <rdias@suse.com>
Wed, 23 Jan 2019 13:59:28 +0000 (13:59 +0000)
Msgr2 version of PR #25754

Signed-off-by: Ricardo Dias <rdias@suse.com>
src/msg/async/ProtocolV2.cc

index 4b203c108362bfe14da59e9fe4ded6dd8dcb9592..3492427210bf8f96cd41e6c7aa9d773d6d790ebc 100644 (file)
@@ -638,7 +638,8 @@ CtPtr ProtocolV2::_fault() {
   connection->fault();
   reset_recv_state();
 
-  if (connection->policy.standby && out_queue.empty() && state != WAIT) {
+  if (connection->policy.standby && out_queue.empty() && !keepalive &&
+      state != WAIT) {
     ldout(cct, 10) << __func__ << " with nothing to send, going to standby"
                    << dendl;
     state = STANDBY;
@@ -2757,6 +2758,13 @@ CtPtr ProtocolV2::handle_existing_connection(AsyncConnectionRef existing) {
                    << dendl;
     ceph_assert(connection->peer_addrs->msgr2_addr() >
                 messenger->get_myaddrs().msgr2_addr());
+
+    existing->lock.unlock();
+    // make sure we follow through with opening the existing
+               // connection (if it isn't yet open) since we know the peer
+               // has something to send to us.
+    existing->send_keepalive();
+    existing->lock.lock();
     WaitFrame wait;
     bufferlist &bl = wait.get_buffer();
     return WRITE(bl, "wait", read_frame);