These are chat archives for alibaba/dubbo

5th
Apr 2018
Allen
@gafflatus
Apr 05 2018 03:25
见到中文真不容易
Adrian Cole
@adriancole
Apr 05 2018 03:52
fyi I noticed sometimes dubbo can choose wrong IP. for example hangs our integration tests openzipkin/brave#680
we use this approach when guessing
      Enumeration<NetworkInterface> nics = NetworkInterface.getNetworkInterfaces();
      if (nics == null) return builder.build();
      while (nics.hasMoreElements()) {
        NetworkInterface nic = nics.nextElement();
        Enumeration<InetAddress> addresses = nic.getInetAddresses();
        while (addresses.hasMoreElements()) {
          InetAddress address = addresses.nextElement();
          if (address.isSiteLocalAddress()) {
            builder.ip(address);
            break;
          }
        }
      }
anyway not sure it breaks other people as unit tests are one thing.. production use another
Adrian Cole
@adriancole
Apr 05 2018 03:57
If I debugged right, we were getting this one which accidentally chose docker IP so hung trying to connect https://github.com/apache/incubator-dubbo/blob/master/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/NetUtils.java#L193
but also depends a lot on my network. ex only happens sometimes (I change network a lot)