]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: clear con->pipe inside pipe_lock on mark_down
authorSage Weil <sage@inktank.com>
Mon, 17 Jun 2013 20:32:07 +0000 (13:32 -0700)
committerSage Weil <sage@inktank.com>
Wed, 24 Jul 2013 23:20:35 +0000 (16:20 -0700)
We need to do this under protection of the pipe_lock.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit afafb87e8402242d3897069f4b94ba46ffe0c413)

src/msg/SimpleMessenger.cc

index dd6b1bd944bcde84b82f31181048822e92cc132b..04b364c3ded56a4ce16eb1b2c8212d7528a29cd0 100644 (file)
@@ -578,6 +578,11 @@ void SimpleMessenger::mark_down(const entity_addr_t& addr)
     p->unregister_pipe();
     p->pipe_lock.Lock();
     p->stop();
+    if (p->connection_state) {
+      // do not generate a reset event for the caller in this case,
+      // since they asked for it.
+      p->connection_state->clear_pipe(p);
+    }
     p->pipe_lock.Unlock();
   } else {
     ldout(cct,1) << "mark_down " << addr << " -- pipe dne" << dendl;
@@ -597,6 +602,11 @@ void SimpleMessenger::mark_down(Connection *con)
     p->unregister_pipe();
     p->pipe_lock.Lock();
     p->stop();
+    if (p->connection_state) {
+      // do not generate a reset event for the caller in this case,
+      // since they asked for it.
+      p->connection_state->clear_pipe(p);
+    }
     p->pipe_lock.Unlock();
     p->put();
   } else {