[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15396380#comment-15396380
 ] 

Chris Nauroth commented on ZOOKEEPER-1256:
------------------------------------------

Patch v3 passes for me on both trunk and branch-3.4, tested on both Mac and 
CentOS 7.

+1 for patch v3, pending a pre-commit run (currently blocked on some 
infrastructure issues).  Flavio, are you OK with that too?

I'm leaving some additional notes here too in case it's useful for anyone in 
the future.  The latest patch got me curious about what exactly was going on 
here.  I adapted this to a code snippet that iterates through all interfaces 
and addresses and prints whether they are considered loopback.  Here is a Scala 
REPL session for that on the Mac:

{code}
def printAddresses() = {
  val ifaces = java.net.NetworkInterface.getNetworkInterfaces
  while (ifaces.hasMoreElements) {
    val iface = ifaces.nextElement
    val addrs = iface.getInetAddresses
    while (addrs.hasMoreElements) {
      val addr = addrs.nextElement
      printf("iface=[%s], iface.isLoopback=[%s], addr=[%s], 
addr.isLoopbackAddress=[%s]%n",
          iface, iface.isLoopback, addr, addr.isLoopbackAddress)
    }
  }
}

scala> printAddresses
printAddresses
iface=[name:awdl0 (awdl0)], iface.isLoopback=[false], 
addr=[/fe80:0:0:0:e836:36ff:fe8f:2795%6], addr.isLoopbackAddress=[false]
iface=[name:vboxnet0 (vboxnet0)], iface.isLoopback=[false], 
addr=[/192.168.56.1], addr.isLoopbackAddress=[false]
iface=[name:en0 (en0)], iface.isLoopback=[false], 
addr=[/fe80:0:0:0:3e15:c2ff:fed1:8136%4], addr.isLoopbackAddress=[false]
iface=[name:en0 (en0)], iface.isLoopback=[false], addr=[/10.22.2.86], 
addr.isLoopbackAddress=[false]
iface=[name:lo0 (lo0)], iface.isLoopback=[true], addr=[/fe80:0:0:0:0:0:0:1%1], 
addr.isLoopbackAddress=[false]
iface=[name:lo0 (lo0)], iface.isLoopback=[true], addr=[/0:0:0:0:0:0:0:1], 
addr.isLoopbackAddress=[true]
iface=[name:lo0 (lo0)], iface.isLoopback=[true], addr=[/127.0.0.1], 
addr.isLoopbackAddress=[true]
{code}

Notice that for /fe80:0:0:0:0:0:0:1%1, the interface is considered loopback, 
but the address is not considered loopback.  That seems wrong.  I assume it has 
something to do with the JDK bugs linked above.

This is different from my CentOS VM, where all addresses associated with the 
loopback interface are also considered loopback:

{code}
scala> printAddresses
iface=[name:enp0s8 (enp0s8)], iface.isLoopback=[false], 
addr=[/fe80:0:0:0:a00:27ff:fe06:287a%enp0s8], addr.isLoopbackAddress=[false]
iface=[name:enp0s8 (enp0s8)], iface.isLoopback=[false], addr=[/192.168.56.105], 
addr.isLoopbackAddress=[false]
iface=[name:enp0s3 (enp0s3)], iface.isLoopback=[false], 
addr=[/fe80:0:0:0:a00:27ff:fea9:db31%enp0s3], addr.isLoopbackAddress=[false]
iface=[name:enp0s3 (enp0s3)], iface.isLoopback=[false], addr=[/10.0.2.15], 
addr.isLoopbackAddress=[false]
iface=[name:lo (lo)], iface.isLoopback=[true], addr=[/0:0:0:0:0:0:0:1%lo], 
addr.isLoopbackAddress=[true]
iface=[name:lo (lo)], iface.isLoopback=[true], addr=[/127.0.0.1], 
addr.isLoopbackAddress=[true]
{code}


> ClientPortBindTest is failing on Mac OS X
> -----------------------------------------
>
>                 Key: ZOOKEEPER-1256
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1256
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: tests
>         Environment: Mac OS X
>            Reporter: Daniel Gómez Ferro
>            Assignee: Flavio Junqueira
>             Fix For: 3.5.3, 3.6.0
>
>         Attachments: ClientPortBindTest.log, ZOOKEEPER-1256.patch, 
> ZOOKEEPER-1256.patch, ZOOKEEPER-1256.patch, ZOOKEEPER-1256v2.patch, 
> ZOOKEEPER-1256v3.patch
>
>
> ClientPortBindTest is failing consistently on Mac OS X.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to