ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1357

Zab1_0Test uses hard-wired port numbers. Specifically, it uses the same port for leader in two different tests. The second test periodically fails complaining that the port is still in use.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.0
    • Fix Version/s: 3.5.0
    • Component/s: tests
    • Labels:
      None

      Description

      Here's what I get:

      Testcase: testLeaderInConnectingFollowers took 34.117 sec
      Testcase: testLastAcceptedEpoch took 0.047 sec <----- new test added in ZK-1343
      Testcase: testLeaderInElectingFollowers took 0.004 sec
      Caused an ERROR
      Address already in use
      java.net.BindException: Address already in use
      at java.net.PlainSocketImpl.socketBind(Native Method)
      at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
      at java.net.ServerSocket.bind(ServerSocket.java:328)
      at java.net.ServerSocket.<init>(ServerSocket.java:194)
      at java.net.ServerSocket.<init>(ServerSocket.java:106)
      at org.apache.zookeeper.server.quorum.Leader.<init>(Leader.java:220)
      at org.apache.zookeeper.server.quorum.Zab1_0Test.createLeader(Zab1_0Test.java:711)
      at org.apache.zookeeper.server.quorum.Zab1_0Test.testLeaderInElectingFollowers(Zab1_0Test.java:225)

      Testcase: testNormalFollowerRun took 29.128 sec
      Testcase: testNormalRun took 25.158 sec
      Testcase: testLeaderBehind took 25.148 sec
      Testcase: testAbandonBeforeACKEpoch took 34.029 sec

      My guess is that testLastAcceptedEpoch doesn't properly close the connection before testLeaderInElectingFollowers starts.
      I propose to add

      if (leadThread != null)

      { leadThread.interrupt(); leadThread.join(); }

      to the test.

      In addition, I propose to change the hard-wired ports in Zab1_0Test to use Portassignment.unique() as done in other tests. If I understand correctly the static counter used in unique() to assign ports is initialized once per test file, so it would also prevent the problem I'm seeing here of two tests in the same file trying to use the same port.

      The error can be reproduced using the attached patch (for some reason I don't see the problem in the trunk).

      1. ZOOKEEPER-1357-v1.patch
        2 kB
        Alexander Shraer
      2. ZOOKEEPER-1357.patch
        2 kB
        Alexander Shraer

        Activity

        Hide
        Patrick Hunt added a comment -

        Alexander Shraer is this still an issue? What's the "affects"?

        Show
        Patrick Hunt added a comment - Alexander Shraer is this still an issue? What's the "affects"?
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12509972/reconfig-8-jan.patch
        against trunk revision 1531061.

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

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

        -1 patch. The patch command could not apply the patch.

        Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1679//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/12509972/reconfig-8-jan.patch against trunk revision 1531061. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 57 new or modified tests. -1 patch. The patch command could not apply the patch. Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1679//console This message is automatically generated.
        Hide
        Alexander Shraer added a comment -

        Part of this was solved by ZOOKEEPER-1522 (the part of correctly terminating leaderThread).
        The hard-wired ports are still there. I can make a patch.

        Show
        Alexander Shraer added a comment - Part of this was solved by ZOOKEEPER-1522 (the part of correctly terminating leaderThread). The hard-wired ports are still there. I can make a patch.
        Hide
        Hadoop QA added a comment -

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

        +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/job/PreCommit-ZOOKEEPER-Build/1681//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1681//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1681//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/12608026/ZOOKEEPER-1357.patch against trunk revision 1531061. +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/job/PreCommit-ZOOKEEPER-Build/1681//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1681//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1681//console This message is automatically generated.
        Hide
        Alexander Shraer added a comment -

        Resubmitting for current trunk. One of the 2 issues mentioned in this jira was already solved. What remained is changed the hard wired ports to Portassignment.unique.

        Show
        Alexander Shraer added a comment - Resubmitting for current trunk. One of the 2 issues mentioned in this jira was already solved. What remained is changed the hard wired ports to Portassignment.unique.
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12640011/ZOOKEEPER-1357-v1.patch
        against trunk revision 1586200.

        +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/job/PreCommit-ZOOKEEPER-Build/2042//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/2042//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/2042//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/12640011/ZOOKEEPER-1357-v1.patch against trunk revision 1586200. +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/job/PreCommit-ZOOKEEPER-Build/2042//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/2042//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/2042//console This message is automatically generated.
        Hide
        Michi Mutsuzaki added a comment -

        +1 thanks Alex.

        Show
        Michi Mutsuzaki added a comment - +1 thanks Alex.
        Show
        Michi Mutsuzaki added a comment - trunk: http://svn.apache.org/viewvc?view=revision&revision=1587335
        Hide
        Hudson added a comment -

        FAILURE: Integrated in ZooKeeper-trunk #2290 (See https://builds.apache.org/job/ZooKeeper-trunk/2290/)
        ZOOKEEPER-1357. Zab1_0Test uses hard-wired port numbers. Specifically, it uses the same port for leader in two different tests. The second test periodically fails complaining that the port is still in use. (Alexander Shraer via michim) (michim: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1587335)

        • /zookeeper/trunk/CHANGES.txt
        • /zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/Zab1_0Test.java
        Show
        Hudson added a comment - FAILURE: Integrated in ZooKeeper-trunk #2290 (See https://builds.apache.org/job/ZooKeeper-trunk/2290/ ) ZOOKEEPER-1357 . Zab1_0Test uses hard-wired port numbers. Specifically, it uses the same port for leader in two different tests. The second test periodically fails complaining that the port is still in use. (Alexander Shraer via michim) (michim: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1587335 ) /zookeeper/trunk/CHANGES.txt /zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/Zab1_0Test.java

          People

          • Assignee:
            Alexander Shraer
            Reporter:
            Alexander Shraer
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development