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

TestWebDelegationToken failing with port in use

    Details

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

      Jenkins

    • Hadoop Flags:
      Reviewed

      Description

      The TestWebDelegationToken failed on Jenkins with port in use. It looks like the code searches for a free port and then starts jetty, but maybe there's enough of a race condition between port location and jetty.start to cause intermittent failures.

        Issue Links

          Activity

          Hide
          stevel@apache.org Steve Loughran added a comment -
          java.net.BindException: Address already in use
          	at java.net.PlainSocketImpl.socketBind(Native Method)
          	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
          	at java.net.ServerSocket.bind(ServerSocket.java:376)
          	at java.net.ServerSocket.<init>(ServerSocket.java:237)
          	at org.mortbay.jetty.bio.SocketConnector.newServerSocket(SocketConnector.java:80)
          	at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:73)
          	at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:283)
          	at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:147)
          	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
          	at org.mortbay.jetty.Server.doStart(Server.java:235)
          	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
          	at org.apache.hadoop.security.token.delegation.web.TestWebDelegationToken.testDelegationTokenAuthenticatorCalls(TestWebDelegationToken.java:352)
          	at org.apache.hadoop.security.token.delegation.web.TestWebDelegationToken.testDelegationTokenAuthenticatorCallsWithHeader(TestWebDelegationToken.java:332)
          
          Show
          stevel@apache.org Steve Loughran added a comment - java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376) at java.net.ServerSocket.bind(ServerSocket.java:376) at java.net.ServerSocket.<init>(ServerSocket.java:237) at org.mortbay.jetty.bio.SocketConnector.newServerSocket(SocketConnector.java:80) at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:73) at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:283) at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:147) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.Server.doStart(Server.java:235) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.apache.hadoop.security.token.delegation.web.TestWebDelegationToken.testDelegationTokenAuthenticatorCalls(TestWebDelegationToken.java:352) at org.apache.hadoop.security.token.delegation.web.TestWebDelegationToken.testDelegationTokenAuthenticatorCallsWithHeader(TestWebDelegationToken.java:332)
          Hide
          stevel@apache.org Steve Loughran added a comment -

          ...and on trunk+java 8

          java.net.BindException: Address already in use
          	at java.net.PlainSocketImpl.socketBind(Native Method)
          	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:382)
          	at java.net.ServerSocket.bind(ServerSocket.java:375)
          	at java.net.ServerSocket.<init>(ServerSocket.java:237)
          	at org.mortbay.jetty.bio.SocketConnector.newServerSocket(SocketConnector.java:80)
          	at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:73)
          	at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:283)
          	at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:147)
          	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
          	at org.mortbay.jetty.Server.doStart(Server.java:235)
          	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
          	at org.apache.hadoop.security.token.delegation.web.TestWebDelegationToken.testProxyUser(TestWebDelegationToken.java:839)
          
          Show
          stevel@apache.org Steve Loughran added a comment - ...and on trunk+java 8 java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:382) at java.net.ServerSocket.bind(ServerSocket.java:375) at java.net.ServerSocket.<init>(ServerSocket.java:237) at org.mortbay.jetty.bio.SocketConnector.newServerSocket(SocketConnector.java:80) at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:73) at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:283) at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:147) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.Server.doStart(Server.java:235) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.apache.hadoop.security.token.delegation.web.TestWebDelegationToken.testProxyUser(TestWebDelegationToken.java:839)
          Hide
          bibinchundatt Bibin A Chundatt added a comment -

          Can we make use of ServerSocketUtil#getPort for starting jetty server ?
          Instead of starting in 0 If it is less than or equal to 0, then an implementation specific default will be used.

          Show
          bibinchundatt Bibin A Chundatt added a comment - Can we make use of ServerSocketUtil#getPort for starting jetty server ? Instead of starting in 0 If it is less than or equal to 0, then an implementation specific default will be used.
          Hide
          wheat9 Haohui Mai added a comment -

          For tests I think it should always listen to port 0 which gives you an ephemeral port.

          Show
          wheat9 Haohui Mai added a comment - For tests I think it should always listen to port 0 which gives you an ephemeral port.
          Hide
          liuml07 Mingliang Liu added a comment -

          When creating jetty sever, the v0 patch always binds port 0 which gives us an ephemeral port, instead of searching a free port before starting jetty.

          In getJettyURL() methods, we should use connector.getLocalPort() after the jetty starts.

          Show
          liuml07 Mingliang Liu added a comment - When creating jetty sever, the v0 patch always binds port 0 which gives us an ephemeral port, instead of searching a free port before starting jetty. In getJettyURL() methods, we should use connector.getLocalPort() after the jetty starts.
          Hide
          hadoopqa Hadoop QA added a comment -



          +1 overall



          Vote Subsystem Runtime Comment
          0 pre-patch 7m 34s Pre-patch trunk compilation is healthy.
          +1 @author 0m 0s The patch does not contain any @author tags.
          +1 tests included 0m 0s The patch appears to include 1 new or modified test files.
          +1 javac 8m 6s There were no new javac warning messages.
          +1 release audit 0m 21s The applied patch does not increase the total number of release audit warnings.
          +1 checkstyle 1m 13s There were no new checkstyle issues.
          +1 whitespace 0m 0s The patch has no lines that end in whitespace.
          +1 install 1m 30s mvn install still works.
          +1 eclipse:eclipse 0m 32s The patch built with eclipse:eclipse.
          +1 findbugs 1m 54s The patch does not introduce any new Findbugs (version 3.0.0) warnings.
          +1 common tests 22m 59s Tests passed in hadoop-common.
              44m 12s  



          Subsystem Report/Notes
          Patch URL http://issues.apache.org/jira/secure/attachment/12756369/HADOOP-12417.000.patch
          Optional Tests javac unit findbugs checkstyle
          git revision trunk / 941001b
          hadoop-common test log https://builds.apache.org/job/PreCommit-HADOOP-Build/7671/artifact/patchprocess/testrun_hadoop-common.txt
          Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/7671/testReport/
          Java 1.7.0_55
          uname Linux asf902.gq1.ygridcore.net 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
          Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/7671/console

          This message was automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - +1 overall Vote Subsystem Runtime Comment 0 pre-patch 7m 34s Pre-patch trunk compilation is healthy. +1 @author 0m 0s The patch does not contain any @author tags. +1 tests included 0m 0s The patch appears to include 1 new or modified test files. +1 javac 8m 6s There were no new javac warning messages. +1 release audit 0m 21s The applied patch does not increase the total number of release audit warnings. +1 checkstyle 1m 13s There were no new checkstyle issues. +1 whitespace 0m 0s The patch has no lines that end in whitespace. +1 install 1m 30s mvn install still works. +1 eclipse:eclipse 0m 32s The patch built with eclipse:eclipse. +1 findbugs 1m 54s The patch does not introduce any new Findbugs (version 3.0.0) warnings. +1 common tests 22m 59s Tests passed in hadoop-common.     44m 12s   Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12756369/HADOOP-12417.000.patch Optional Tests javac unit findbugs checkstyle git revision trunk / 941001b hadoop-common test log https://builds.apache.org/job/PreCommit-HADOOP-Build/7671/artifact/patchprocess/testrun_hadoop-common.txt Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/7671/testReport/ Java 1.7.0_55 uname Linux asf902.gq1.ygridcore.net 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 Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/7671/console This message was automatically generated.
          Hide
          wheat9 Haohui Mai added a comment -

          +1

          Show
          wheat9 Haohui Mai added a comment - +1
          Hide
          wheat9 Haohui Mai added a comment -

          I've committed the patch to trunk and branch-2. Thanks Mingliang Liu for the contribution.

          Show
          wheat9 Haohui Mai added a comment - I've committed the patch to trunk and branch-2. Thanks Mingliang Liu for the contribution.
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-trunk-Commit #8468 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8468/)
          HADOOP-12417. TestWebDelegationToken failing with port in use. Contributed by Mingliang Liu. (wheat9: rev 0832b38d482238e87e2529d80d09881a5c90ccff)

          • hadoop-common-project/hadoop-common/CHANGES.txt
          • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #8468 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8468/ ) HADOOP-12417 . TestWebDelegationToken failing with port in use. Contributed by Mingliang Liu. (wheat9: rev 0832b38d482238e87e2529d80d09881a5c90ccff) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Hadoop-Yarn-trunk #1140 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/1140/)
          HADOOP-12417. TestWebDelegationToken failing with port in use. Contributed by Mingliang Liu. (wheat9: rev 0832b38d482238e87e2529d80d09881a5c90ccff)

          • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java
          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Yarn-trunk #1140 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/1140/ ) HADOOP-12417 . TestWebDelegationToken failing with port in use. Contributed by Mingliang Liu. (wheat9: rev 0832b38d482238e87e2529d80d09881a5c90ccff) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java hadoop-common-project/hadoop-common/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #406 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/406/)
          HADOOP-12417. TestWebDelegationToken failing with port in use. Contributed by Mingliang Liu. (wheat9: rev 0832b38d482238e87e2529d80d09881a5c90ccff)

          • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java
          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #406 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/406/ ) HADOOP-12417 . TestWebDelegationToken failing with port in use. Contributed by Mingliang Liu. (wheat9: rev 0832b38d482238e87e2529d80d09881a5c90ccff) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java hadoop-common-project/hadoop-common/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Hdfs-trunk #2321 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2321/)
          HADOOP-12417. TestWebDelegationToken failing with port in use. Contributed by Mingliang Liu. (wheat9: rev 0832b38d482238e87e2529d80d09881a5c90ccff)

          • hadoop-common-project/hadoop-common/CHANGES.txt
          • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk #2321 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2321/ ) HADOOP-12417 . TestWebDelegationToken failing with port in use. Contributed by Mingliang Liu. (wheat9: rev 0832b38d482238e87e2529d80d09881a5c90ccff) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #399 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/399/)
          HADOOP-12417. TestWebDelegationToken failing with port in use. Contributed by Mingliang Liu. (wheat9: rev 0832b38d482238e87e2529d80d09881a5c90ccff)

          • hadoop-common-project/hadoop-common/CHANGES.txt
          • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #399 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/399/ ) HADOOP-12417 . TestWebDelegationToken failing with port in use. Contributed by Mingliang Liu. (wheat9: rev 0832b38d482238e87e2529d80d09881a5c90ccff) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Mapreduce-trunk #2346 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2346/)
          HADOOP-12417. TestWebDelegationToken failing with port in use. Contributed by Mingliang Liu. (wheat9: rev 0832b38d482238e87e2529d80d09881a5c90ccff)

          • hadoop-common-project/hadoop-common/CHANGES.txt
          • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk #2346 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2346/ ) HADOOP-12417 . TestWebDelegationToken failing with port in use. Contributed by Mingliang Liu. (wheat9: rev 0832b38d482238e87e2529d80d09881a5c90ccff) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #382 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/382/)
          HADOOP-12417. TestWebDelegationToken failing with port in use. Contributed by Mingliang Liu. (wheat9: rev 0832b38d482238e87e2529d80d09881a5c90ccff)

          • hadoop-common-project/hadoop-common/CHANGES.txt
          • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #382 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/382/ ) HADOOP-12417 . TestWebDelegationToken failing with port in use. Contributed by Mingliang Liu. (wheat9: rev 0832b38d482238e87e2529d80d09881a5c90ccff) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java

            People

            • Assignee:
              liuml07 Mingliang Liu
              Reporter:
              stevel@apache.org Steve Loughran
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development