]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg: async: start over after failing to bind a port in specified range 7852/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 1 Mar 2016 11:03:00 +0000 (19:03 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 1 Mar 2016 14:45:14 +0000 (22:45 +0800)
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 <xie.xingguo@zte.com.cn>
src/msg/async/AsyncMessenger.cc

index d417b8698fee82b3f9b6923c826b62344830cbb3..8e82adfc42c23e92c79fa17b21ace998ea664d19 100644 (file)
@@ -140,6 +140,7 @@ int Processor::bind(const entity_addr_t &bind_addr, const set<int>& 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;