]> 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>
Sun, 23 Jun 2013 22:10:24 +0000 (15:10 -0700)
We need to do this under protection of the pipe_lock.

Signed-off-by: Sage Weil <sage@inktank.com>
src/msg/SimpleMessenger.cc

index 994f849c1eb21fd6c4b6a45b1adda3ca41e26d7c..2bee4d6370d8c03857c2e5082e71b271925e5289 100644 (file)
@@ -579,6 +579,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;
@@ -598,6 +603,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 {