ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1059

stat command isses on non-existing node causes NPE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.0
    • Component/s: java client
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      stat command issues on non existing zookeeper node,causes NPE to the client.

      [zk: localhost:2181(CONNECTED) 2] stat /invalidPath
      Exception in thread "main" java.lang.NullPointerException
              at org.apache.zookeeper.ZooKeeperMain.printStat(ZooKeeperMain.java:131)
              at org.apache.zookeeper.ZooKeeperMain.processZKCmd(ZooKeeperMain.java:723)
              at org.apache.zookeeper.ZooKeeperMain.processCmd(ZooKeeperMain.java:582)
              at org.apache.zookeeper.ZooKeeperMain.executeLine(ZooKeeperMain.java:354)
              at org.apache.zookeeper.ZooKeeperMain.run(ZooKeeperMain.java:312)
              at org.apache.zookeeper.ZooKeeperMain.main(ZooKeeperMain.java:271)
      
      
      1. ZOOKEEPER-1059.patch
        2 kB
        Bhallamudi Venkata Siva Kamesh

        Activity

        Hide
        Bhallamudi Venkata Siva Kamesh added a comment -

        When stat command is issued with a path,zookeeper returns the stat of node of the given path.If no such node exists returns null.

        ZooKeeperMain.java
        stat = zk.exists(path, watch); // Returns null when No node exists of given path
        printStat(stat); // When stat is null, this method throws NPE
        
        Show
        Bhallamudi Venkata Siva Kamesh added a comment - When stat command is issued with a path,zookeeper returns the stat of node of the given path.If no such node exists returns null. ZooKeeperMain.java stat = zk.exists(path, watch); // Returns null when No node exists of given path printStat(stat); // When stat is null , this method throws NPE
        Hide
        Mahadev konar added a comment -

        bhallamudi,
        Would you mind putting up a patch for it?

        Show
        Mahadev konar added a comment - bhallamudi, Would you mind putting up a patch for it?
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12479085/ZOOKEEPER-1059.patch
        against trunk revision 1099329.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 3 new or modified tests.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed core unit tests.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/261//testReport/
        Findbugs warnings: https://builds.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/261//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://builds.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/261//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - +1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12479085/ZOOKEEPER-1059.patch against trunk revision 1099329. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/261//testReport/ Findbugs warnings: https://builds.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/261//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/261//console This message is automatically generated.
        Hide
        Mahadev konar added a comment -

        +1 the patch looks good.

        Show
        Mahadev konar added a comment - +1 the patch looks good.
        Hide
        Mahadev konar added a comment -

        I just commmitted this to trunk. thanks Bhallamudi.

        Show
        Mahadev konar added a comment - I just commmitted this to trunk. thanks Bhallamudi.
        Hide
        Hudson added a comment -

        Integrated in ZooKeeper-trunk #1185 (See https://builds.apache.org/hudson/job/ZooKeeper-trunk/1185/)
        ZOOKEEPER-1059. stat command isses on non-existing node causes NPE. (Bhallamudi Kamesh via mahadev)

        Show
        Hudson added a comment - Integrated in ZooKeeper-trunk #1185 (See https://builds.apache.org/hudson/job/ZooKeeper-trunk/1185/ ) ZOOKEEPER-1059 . stat command isses on non-existing node causes NPE. (Bhallamudi Kamesh via mahadev)

          People

          • Assignee:
            Bhallamudi Venkata Siva Kamesh
            Reporter:
            Bhallamudi Venkata Siva Kamesh
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development