]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgrc: mark down connections with dead sessions
authorJohn Spray <john.spray@redhat.com>
Thu, 4 Aug 2016 14:03:51 +0000 (15:03 +0100)
committerJohn Spray <john.spray@redhat.com>
Thu, 29 Sep 2016 16:27:03 +0000 (17:27 +0100)
Signed-off-by: John Spray <john.spray@redhat.com>
src/mgr/MgrClient.cc

index 3f32934f707a5aef59f3a12baa338c6ac1f3049b..5dfb8de77068c0c431ca86026de86587295101c4 100644 (file)
@@ -95,6 +95,7 @@ bool MgrClient::handle_mgr_map(MMgrMap *m)
     if (session) {
       ldout(cct, 4) << "Terminating session with "
                     << session->con->get_peer_addr() << dendl;
+      session->con->mark_down();
       delete session;
       session = nullptr;
       stats_period = 0;
@@ -286,7 +287,7 @@ int MgrClient::start_command(const vector<string>& cmd, const bufferlist& inbl,
   ldout(cct, 20) << "cmd: " << cmd << dendl;
 
   if (session == nullptr) {
-    derr << "no session, waiting" << dendl;
+    lderr(cct) << "no session, waiting" << dendl;
     wait_on_list(waiting_for_session);
   }
 
@@ -301,6 +302,8 @@ int MgrClient::start_command(const vector<string>& cmd, const bufferlist& inbl,
 
   // Leaving fsid argument null because it isn't used.
   MCommand *m = op->get_message({});
+  assert(session);
+  assert(session->con);
   session->con->send_message(m);
 
   return 0;