From: Nathan Cutler Date: Fri, 4 Sep 2015 15:38:32 +0000 (+0200) Subject: osd: Keep a reference count on Connection while calling send_message() X-Git-Tag: v0.80.11~3^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f39c7917a39e445efa8d73178657fc5960772275;p=ceph.git osd: Keep a reference count on Connection while calling send_message() Fixes: #12437 Signed-off-by: David Zafman (manual backport of commit a140085) Conflicts: src/osd/OSD.cc master has share_map_peer; firefly has osd->_share_map_outgoing --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index d2c0a341ab82..81f188df1f5e 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -3951,8 +3951,8 @@ void OSDService::send_message_osd_cluster(int peer, Message *m, epoch_t from_epo return; } const entity_inst_t& peer_inst = next_osdmap->get_cluster_inst(peer); - Connection *peer_con = osd->cluster_messenger->get_connection(peer_inst).get(); - osd->_share_map_outgoing(peer, peer_con, next_osdmap); + ConnectionRef peer_con = osd->cluster_messenger->get_connection(peer_inst); + osd->_share_map_outgoing(peer, peer_con.get(), next_osdmap); osd->cluster_messenger->send_message(m, peer_inst); }