From 8ffc4e800140e8304b91501d5df659e49b5eb122 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Tue, 1 Mar 2016 19:03:00 +0800 Subject: [PATCH] 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 --- src/msg/async/AsyncMessenger.cc | 1 + 1 file changed, 1 insertion(+) 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; -- 2.47.3