ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1991

zkServer.sh returns with a zero exit status when a ZooKeeper process is already running

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4.6
    • Fix Version/s: 3.5.2, 3.6.0
    • Component/s: scripts
    • Labels:
      None

      Description

      If ZooKeeper is started with zkServer.sh, and an error is shown that a ZooKeeper process is already running, the command returns with an exit status of 0, while it should end with a non-zero exit status.

      Example:
      $ bin/zkServer.sh start
      JMX enabled by default
      Using config: /home/reed/zookeeper/bin/../conf/zoo.cfg
      Starting zookeeper ... already running as process 25063.
      $ echo $?
      0

      This can make it difficult for automated scripts to check if creating a new ZooKeeper process was successful, as it won't catch if a user accidentally started it before.

        Activity

        Hide
        Patrick Hunt added a comment -

        Reed you want to give this a try? (patch I mean). Thanks.

        Show
        Patrick Hunt added a comment - Reed you want to give this a try? (patch I mean). Thanks.
        Hide
        Biju Nair added a comment -

        Patch to return RC of 1 if user tries to start ZooKeeper server when another instance of the server is currently running.

        Show
        Biju Nair added a comment - Patch to return RC of 1 if user tries to start ZooKeeper server when another instance of the server is currently running.
        Hide
        Biju Nair added a comment -

        Patrick Hunt could you please review the simple change?

        Show
        Biju Nair added a comment - Patrick Hunt could you please review the simple change?
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12790607/ZOOKEEPER-1991.patch
        against trunk revision 1729259.

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

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +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 2.0.3) warnings.

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

        -1 core tests. The patch failed core unit tests.

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

        Test results: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/3055//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/3055//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/3055//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/12790607/ZOOKEEPER-1991.patch against trunk revision 1729259. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +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 2.0.3) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/3055//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/3055//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/3055//console This message is automatically generated.
        Hide
        Patrick Hunt added a comment -

        Looks good to me. Thanks Biju Nair!

        Show
        Patrick Hunt added a comment - Looks good to me. Thanks Biju Nair !
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in ZooKeeper-trunk #2835 (See https://builds.apache.org/job/ZooKeeper-trunk/2835/)
        ZOOKEEPER-1991 zkServer.sh returns with a zero exit status when a ZooKeeper process is already running (gsbiju via phunt) (phunt: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1733348)

        • trunk/bin/zkServer.sh
        Show
        Hudson added a comment - SUCCESS: Integrated in ZooKeeper-trunk #2835 (See https://builds.apache.org/job/ZooKeeper-trunk/2835/ ) ZOOKEEPER-1991 zkServer.sh returns with a zero exit status when a ZooKeeper process is already running (gsbiju via phunt) (phunt: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1733348 ) trunk/bin/zkServer.sh

          People

          • Assignee:
            Biju Nair
            Reporter:
            Reed Wanderman-Milne
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development