Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-12656

MiniKdc throws "address in use" BindException

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: None
    • Labels:
      None
    • Environment:

      Jenkins

    • Hadoop Flags:
      Reviewed

      Description

      Another address in use error.

      I saw the test TestKerberosAuthenticationHandler.testNameRules failed due to porting binding error.
      https://builds.apache.org/job/Hadoop-common-trunk-Java8/827/testReport/org.apache.hadoop.security.authentication.server/TestKerberosAuthenticationHandler/testNameRules/

      Looking at MiniKdc implementation, if port is 0, the constructor use ServerSocket to find an unused port, assign the port number to the member variable port and close the ServerSocket object; later, in initKDCServer(), instantiate a TcpTransport object and bind at that port.

      It appears that the port may be used in between, and then throw the exception.

        Activity

        Hide
        jojochuang Wei-Chiu Chuang added a comment -

        Assigning this JIRA to myself. I think it should be possible to use an ephemeral port by specifying port number 0.

        Show
        jojochuang Wei-Chiu Chuang added a comment - Assigning this JIRA to myself. I think it should be possible to use an ephemeral port by specifying port number 0.
        Hide
        jojochuang Wei-Chiu Chuang added a comment -

        Rev01: removed the two step port binding to avoid race condition. Use port number 0 in TcpTransport/UdpTransport to get an ephemeral port for binding. Remove ServerSocket entirely.

        Show
        jojochuang Wei-Chiu Chuang added a comment - Rev01: removed the two step port binding to avoid race condition. Use port number 0 in TcpTransport/UdpTransport to get an ephemeral port for binding. Remove ServerSocket entirely.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 0s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 test4tests 0m 0s 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 mvninstall 10m 7s trunk passed
        +1 compile 9m 3s trunk passed with JDK v1.8.0_66
        +1 compile 10m 7s trunk passed with JDK v1.7.0_91
        +1 checkstyle 0m 10s trunk passed
        +1 mvnsite 0m 21s trunk passed
        +1 mvneclipse 0m 16s trunk passed
        +1 findbugs 0m 35s trunk passed
        +1 javadoc 0m 14s trunk passed with JDK v1.8.0_66
        +1 javadoc 0m 15s trunk passed with JDK v1.7.0_91
        +1 mvninstall 0m 19s the patch passed
        +1 compile 9m 38s the patch passed with JDK v1.8.0_66
        +1 javac 9m 38s the patch passed
        +1 compile 9m 52s the patch passed with JDK v1.7.0_91
        +1 javac 9m 52s the patch passed
        +1 checkstyle 0m 8s the patch passed
        +1 mvnsite 0m 18s the patch passed
        +1 mvneclipse 0m 13s the patch passed
        +1 whitespace 0m 0s Patch has no whitespace issues.
        +1 findbugs 0m 33s the patch passed
        +1 javadoc 0m 11s the patch passed with JDK v1.8.0_66
        +1 javadoc 0m 13s the patch passed with JDK v1.7.0_91
        +1 unit 2m 14s hadoop-minikdc in the patch passed with JDK v1.8.0_66.
        +1 unit 2m 18s hadoop-minikdc in the patch passed with JDK v1.7.0_91.
        +1 asflicense 0m 24s Patch does not generate ASF License warnings.
        58m 42s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:0ca8df7
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12778600/HADOOP-12656.001.patch
        JIRA Issue HADOOP-12656
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 7152112a09e8 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / e63388f
        findbugs v3.0.0
        JDK v1.7.0_91 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/8280/testReport/
        modules C: hadoop-common-project/hadoop-minikdc U: hadoop-common-project/hadoop-minikdc
        Max memory used 75MB
        Powered by Apache Yetus 0.2.0-SNAPSHOT http://yetus.apache.org
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/8280/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 0s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. -1 test4tests 0m 0s 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 mvninstall 10m 7s trunk passed +1 compile 9m 3s trunk passed with JDK v1.8.0_66 +1 compile 10m 7s trunk passed with JDK v1.7.0_91 +1 checkstyle 0m 10s trunk passed +1 mvnsite 0m 21s trunk passed +1 mvneclipse 0m 16s trunk passed +1 findbugs 0m 35s trunk passed +1 javadoc 0m 14s trunk passed with JDK v1.8.0_66 +1 javadoc 0m 15s trunk passed with JDK v1.7.0_91 +1 mvninstall 0m 19s the patch passed +1 compile 9m 38s the patch passed with JDK v1.8.0_66 +1 javac 9m 38s the patch passed +1 compile 9m 52s the patch passed with JDK v1.7.0_91 +1 javac 9m 52s the patch passed +1 checkstyle 0m 8s the patch passed +1 mvnsite 0m 18s the patch passed +1 mvneclipse 0m 13s the patch passed +1 whitespace 0m 0s Patch has no whitespace issues. +1 findbugs 0m 33s the patch passed +1 javadoc 0m 11s the patch passed with JDK v1.8.0_66 +1 javadoc 0m 13s the patch passed with JDK v1.7.0_91 +1 unit 2m 14s hadoop-minikdc in the patch passed with JDK v1.8.0_66. +1 unit 2m 18s hadoop-minikdc in the patch passed with JDK v1.7.0_91. +1 asflicense 0m 24s Patch does not generate ASF License warnings. 58m 42s Subsystem Report/Notes Docker Image:yetus/hadoop:0ca8df7 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12778600/HADOOP-12656.001.patch JIRA Issue HADOOP-12656 Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 7152112a09e8 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / e63388f findbugs v3.0.0 JDK v1.7.0_91 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/8280/testReport/ modules C: hadoop-common-project/hadoop-minikdc U: hadoop-common-project/hadoop-minikdc Max memory used 75MB Powered by Apache Yetus 0.2.0-SNAPSHOT http://yetus.apache.org Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/8280/console This message was automatically generated.
        Hide
        jojochuang Wei-Chiu Chuang added a comment -

        Passed all tests.
        The existing test TestMiniKdc#testMiniKdcStart() verifies the bug, so no additional test are needed.

        Show
        jojochuang Wei-Chiu Chuang added a comment - Passed all tests. The existing test TestMiniKdc#testMiniKdcStart() verifies the bug, so no additional test are needed.
        Hide
        arpitagarwal Arpit Agarwal added a comment -

        +1 for the patch. I will commit it shortly.

        Thank you for the continued effort to make our tests more reliable Wei-Chiu Chuang.

        Show
        arpitagarwal Arpit Agarwal added a comment - +1 for the patch. I will commit it shortly. Thank you for the continued effort to make our tests more reliable Wei-Chiu Chuang .
        Hide
        arpitagarwal Arpit Agarwal added a comment -

        Committed for 2.8.0.

        Show
        arpitagarwal Arpit Agarwal added a comment - Committed for 2.8.0.
        Hide
        jojochuang Wei-Chiu Chuang added a comment -

        Thank you! Arpit Agarwal It was nice working with you

        Show
        jojochuang Wei-Chiu Chuang added a comment - Thank you! Arpit Agarwal It was nice working with you
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-trunk-Commit #9001 (See https://builds.apache.org/job/Hadoop-trunk-Commit/9001/)
        HADOOP-12656. MiniKdc throws "address in use" BindException. (arp: rev 8fb70a031b323634ddc51ff6aff4f376baef68c8)

        • hadoop-common-project/hadoop-minikdc/src/main/java/org/apache/hadoop/minikdc/MiniKdc.java
        • hadoop-common-project/hadoop-common/CHANGES.txt
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-trunk-Commit #9001 (See https://builds.apache.org/job/Hadoop-trunk-Commit/9001/ ) HADOOP-12656 . MiniKdc throws "address in use" BindException. (arp: rev 8fb70a031b323634ddc51ff6aff4f376baef68c8) hadoop-common-project/hadoop-minikdc/src/main/java/org/apache/hadoop/minikdc/MiniKdc.java hadoop-common-project/hadoop-common/CHANGES.txt

          People

          • Assignee:
            jojochuang Wei-Chiu Chuang
            Reporter:
            jojochuang Wei-Chiu Chuang
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development