summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-16 22:43:26 -0700
committerSage Weil <sage@inktank.com>2013-07-18 15:02:08 -0700
commite1e0d5056d00772840a75ce3ac7cd1f172ba182a (patch)
tree43476f6510e71fd3825c997c89fc37020fbce0bd
parentc5226346cb16129b572c45bd32572b6ec3fbe5f5 (diff)
downloadceph-e1e0d5056d00772840a75ce3ac7cd1f172ba182a.tar.gz
msgr: generate reset event on mark_down to addr (not con)
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>
-rw-r--r--src/msg/SimpleMessenger.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc
index afee0952630..441ed432af0 100644
--- a/src/msg/SimpleMessenger.cc
+++ b/src/msg/SimpleMessenger.cc
@@ -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 {