]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: generate reset event on mark_down to addr (not con)
authorSage Weil <sage@inktank.com>
Wed, 17 Jul 2013 05:43:26 +0000 (22:43 -0700)
committerSage Weil <sage@inktank.com>
Thu, 18 Jul 2013 22:02:08 +0000 (15:02 -0700)
If the caller is marking down an addr, they presumably don't have the
Connection* handy, so we should generate a reset event to help them
clean up con <-> session ref cycles.

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

index afee0952630e5d79613b29a3ddac8ab4ccafd744..441ed432af00bf57c085482cde46a8290262c110 100644 (file)
@@ -599,9 +599,12 @@ void SimpleMessenger::mark_down(const entity_addr_t& addr)
     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);
+      // generate a reset event for the caller in this case, even
+      // though they asked for it, since this is the addr-based (and
+      // not Connection* based) interface
+      ConnectionRef con = p->connection_state;
+      if (con && con->clear_pipe(p))
+       dispatch_queue.queue_reset(con.get());
     }
     p->pipe_lock.Unlock();
   } else {