UnknownHostException in QuorumCnxManager
----------------------------------------
Key: ZOOKEEPER-979
URL: https://issues.apache.org/jira/browse/ZOOKEEPER-979
Project: ZooKeeper
Issue Type: Bug
Components: server
Affects Versions: 3.3.2
Reporter: Hugh Warrington
Priority: Minor
I'm using zk 3.3.2 and I'm seeing this in my logs around startup:
{{2011-01-27 10:16:21,513 [WorkerSender Thread] WARN
org.apache.zookeeper.server.quorum.QuorumCnxManager - Cannot open channel to 0
at election address xxx.yyy.com/10.2.131.19:3888
java.net.UnknownHostException
at sun.nio.ch.Net.translateException(Net.java:100)
at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:140)
at
org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:366)
at
org.apache.zookeeper.server.quorum.QuorumCnxManager.toSend(QuorumCnxManager.java:335)
at
org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.process(FastLeaderElection.java:360)
at
org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.run(FastLeaderElection.java:333)
at java.lang.Thread.run(Thread.java:636)}}
And all subsequent zk ops give {{ConnectionLossException}}.
I've just explained this to breed_zk on IRC, and he asked me to file a ticket,
mentioning that UnknownHostException may sometimes be thrown for reasons other
than host resolution. While I'm reasonably certain that the hostname is correct
and should be contactable, I need to put some more time into checking our
network setup to be absolutely sure. However, two observations arose while
looking into this:
* At the top of QuorumCnxManager.connectOne(), we set electionAddr (or fail and
return). But then a few lines later we don't actually use this local variable
in the call to connect(). This seems like a minor programming mistake (although
AFAICT it doesn't change the behaviour).
* In the subsequent catch block, the UnknownHostException that's thrown doesn't
contain the address that we were trying to connect to (though if you capture
WARN log messages, you can see what it was).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.