Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-1875

NullPointerException in ClientCnxn$EventThread.processEvent

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Minor
    • Resolution: Unresolved
    • 3.4.5, 3.4.10
    • None
    • java client

    Description

      We've been seeing NullPointerException while working on HBase:

      14/01/30 22:15:25 INFO zookeeper.ZooKeeper: Client environment:user.dir=/home/biadmin/hbase-trunk
      14/01/30 22:15:25 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=hdtest009:2181 sessionTimeout=90000 watcher=null
      14/01/30 22:15:25 INFO zookeeper.ClientCnxn: Opening socket connection to server hdtest009/9.30.194.18:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
      14/01/30 22:15:25 INFO zookeeper.ClientCnxn: Socket connection established to hdtest009/9.30.194.18:2181, initiating session
      14/01/30 22:15:25 INFO zookeeper.ClientCnxn: Session establishment complete on server hdtest009/9.30.194.18:2181, sessionid = 0x143986213e67e48, negotiated timeout = 60000
      14/01/30 22:15:25 ERROR zookeeper.ClientCnxn: Error while calling watcher
      java.lang.NullPointerException
              at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:519)
              at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:495)
      

      The reason is the watcher is null in this part of the code:

             private void processEvent(Object event) {
                try {
                    if (event instanceof WatcherSetEventPair) {
                        // each watcher will process the event
                        WatcherSetEventPair pair = (WatcherSetEventPair) event;
                        for (Watcher watcher : pair.watchers) {
                            try {
                                watcher.process(pair.event);
                            } catch (Throwable t) {
                                LOG.error("Error while calling watcher ", t);
                            }
                        }
      

      Attachments

        1. ZOOKEEPER-1875-trunk.patch
          0.8 kB
          Jerry He
        2. ZOOKEEPER-1875.patch
          1 kB
          Rakesh Radhakrishnan
        3. ZOOKEEPER-1875.patch
          4 kB
          Rakesh Radhakrishnan

        Issue Links

          Activity

            People

              arshad.mohammad Mohammad Arshad
              jinghe Jerry He
              Votes:
              2 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m