diff options
author | Sage Weil <sage@inktank.com> | 2013-07-16 22:43:26 -0700 |
---|---|---|
committer | Greg Farnum <greg@inktank.com> | 2013-07-19 13:21:47 -0700 |
commit | 8dcf0b199af36f0f3b3fb81103949050d53750e4 (patch) | |
tree | 9b4b3deaf6237f795a31d06a17c8a249e97db1c1 | |
parent | bfadcd2a0eb48c0a46666db9647a6ad9fe24a038 (diff) | |
download | ceph-8dcf0b199af36f0f3b3fb81103949050d53750e4.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.cc | 9 |
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 { |