[
https://issues.apache.org/jira/browse/ZOOKEEPER-1683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13624048#comment-13624048
]
Alexander Shraer commented on ZOOKEEPER-1683:
---------------------------------------------
Thanks Shevek. I'd like to focus on the bug in updateServerList(), so I think
its a good idea to split the other issue into a separate jira.
For updateServerList() I was at first thinking to treat the case of currentHost
being null similarly to the case where the currentHost is not in the new list
of servers. But then I realized that this will create imbalance. Now I'm
thinking maybe we should look on the server to which the client should have
been connected as currentHost and run the algorithm from there. Or maybe if we
consider the null case to be very rare we could ignore the imbalance that it
can create :) I'm still looking into it.
> ZooKeeper client NPE when updating server list on disconnected client
> ---------------------------------------------------------------------
>
> Key: ZOOKEEPER-1683
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1683
> Project: ZooKeeper
> Issue Type: Bug
> Reporter: Shevek
> Assignee: Alexander Shraer
>
> 2013-04-04 22:16:15,872 ERROR [pool-4-thread-1]
> com.netflix.curator.ConnectionState.getZooKeeper (ConnectionState.java:84) -
> Background exception caught
> java.lang.NullPointerException
> at
> org.apache.zookeeper.client.StaticHostProvider.updateServerList(StaticHostProvider.java:161)
> ~[zookeeper-3.5.0.jar:3.5.0--1]
> at
> org.apache.zookeeper.ZooKeeper.updateServerList(ZooKeeper.java:183)
> ~[zookeeper-3.5.0.jar:3.5.0--1]
> at
> com.netflix.curator.HandleHolder$1$1.setConnectionString(HandleHolder.java:121)
> ~[curator-client-1.3.5-SNAPSHOT.jar:?]
> The duff code is this:
> ClientCnxnSocket clientCnxnSocket = cnxn.sendThread.getClientCnxnSocket();
> InetSocketAddress currentHost = (InetSocketAddress)
> clientCnxnSocket.getRemoteSocketAddress();
> boolean reconfigMode = hostProvider.updateServerList(serverAddresses,
> currentHost);
> Now, currentHost might be null, if we're not yet connected. But
> StaticHostProvider.updateServerList indirects on it unconditionally.
> This would be caught by findbugs.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira