From: xie xingguo Date: Tue, 1 Mar 2016 11:03:00 +0000 (+0800) Subject: msg: async: start over after failing to bind a port in specified range X-Git-Tag: v10.1.0~272^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F7852%2Fhead;p=ceph.git msg: async: start over after failing to bind a port in specified range The original report associated with this fix can be found at http://tracker.ceph.com/issues/13002. I reopen one in case it needs to be backported or something alike. Fixes: #14928 Signed-off-by: xie xingguo --- diff --git a/src/msg/async/AsyncMessenger.cc b/src/msg/async/AsyncMessenger.cc index d417b8698fee8..8e82adfc42c23 100644 --- a/src/msg/async/AsyncMessenger.cc +++ b/src/msg/async/AsyncMessenger.cc @@ -140,6 +140,7 @@ int Processor::bind(const entity_addr_t &bind_addr, const set& avoid_ports) << "-" << msgr->cct->_conf->ms_bind_port_max << ": " << cpp_strerror(errno) << dendl; r = -errno; + listen_addr.set_port(0); // Clear port before retry, otherwise we shall fail again. continue; } ldout(msgr->cct, 10) << __func__ << " bound on random port " << listen_addr << dendl;