hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Krystian Nowak (Created) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HBASE-5289) NullPointerException in resetZooKeeperTrackers in HConnectionManager / HConnectionImplementation
Date Thu, 26 Jan 2012 20:57:40 GMT
NullPointerException in resetZooKeeperTrackers in HConnectionManager / HConnectionImplementation

                 Key: HBASE-5289
                 URL: https://issues.apache.org/jira/browse/HBASE-5289
             Project: HBase
          Issue Type: Bug
          Components: client
    Affects Versions: 0.90.5
            Reporter: Krystian Nowak

This might happen on heavy load in case of lagging HBase when sharing one HConnection by multiple

2012-01-26 13:59:38,396 ERROR [http://*:8080-251-EventThread] zookeeper.ClientCnxn$EventThread(532):
Error while calling watcher
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.resetZooKeeperTrackers(HConnectionManager.java:533)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.abort(HConnectionManager.java:1536)
        at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.connectionEvent(ZooKeeperWatcher.java:344)
        at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.process(ZooKeeperWatcher.java:262)
        at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:530)
        at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:506)

The following code is not protected against NPE:

    private synchronized void resetZooKeeperTrackers()
        throws ZooKeeperConnectionException {
      LOG.info("Trying to reconnect to zookeeper");
      masterAddressTracker = null;
      rootRegionTracker = null;
      clusterId = null;
      this.zooKeeper = null;

In some cases as proven by the log snippet above it might happen that either masterAddressTracker
or rootRegionTracker might be null.
Because of the NPE the code can't reach setupZookeeperTrackers() call.

This should be fixed at least the way as shown in one of the patches in HBASE-5153

      LOG.info("Trying to reconnect to zookeeper.");
      if (this.masterAddressTracker != null) {
        this.masterAddressTracker = null;
      if (this.rootRegionTracker != null) {
        this.rootRegionTracker = null;

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message