]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: mark down by Connection*
authorSage Weil <sage@newdream.net>
Tue, 14 Dec 2010 22:28:26 +0000 (14:28 -0800)
committerSage Weil <sage@newdream.net>
Wed, 15 Dec 2010 19:01:50 +0000 (11:01 -0800)
Signed-off-by: Sage Weil <sage@newdream.net>
src/msg/Messenger.h
src/msg/SimpleMessenger.cc
src/msg/SimpleMessenger.h

index 873ef671dc6e4e7660b607f901de282a34faf18e..4b806468f54646940c60229c6bf561ff455e3dd5 100644 (file)
@@ -156,6 +156,7 @@ protected:
   virtual int send_keepalive(const entity_inst_t& dest) = 0;
 
   virtual void mark_down(const entity_addr_t& a) = 0;
+  virtual void mark_down(Connection *con) = 0;
 
   virtual Connection *get_connection(const entity_inst_t& dest) = 0;
 
index ebaae0698529f39f24afc999d0f7177f42fe6ab7..cc8916bb051e33f761c261346e6339c1b2c8f7dc 100644 (file)
@@ -2735,6 +2735,23 @@ void SimpleMessenger::mark_down(const entity_addr_t& addr)
   lock.Unlock();
 }
 
+void SimpleMessenger::mark_down(Connection *con)
+{
+  lock.Lock();
+  Pipe *p = (Pipe *)con->get_pipe();
+  if (p) {
+    dout(1) << "mark_down " << con << " -- " << p << dendl;
+    p->unregister_pipe();
+    p->pipe_lock.Lock();
+    p->stop();
+    p->pipe_lock.Unlock();
+    p->put();
+  } else {
+    dout(1) << "mark_down " << con << " -- pipe dne" << dendl;
+  }
+  lock.Unlock();
+}
+
 void SimpleMessenger::learned_addr(entity_addr_t peer_addr_for_me)
 {
   lock.Lock();
index 5f1b93739636a55aee2cb640d101a0acf8d07ada..9196c190f9e1563a0ac234cf588c9e975811d251 100644 (file)
@@ -471,6 +471,7 @@ private:
   const entity_addr_t &get_ms_addr() { return ms_addr; }
 
   void mark_down(const entity_addr_t& addr);
+  void mark_down(Connection *con);
   void mark_down_all();
 
   // reaper