Hadoop Common
  1. Hadoop Common
  2. HADOOP-7593

AssertionError in TestHttpServer.testMaxThreads()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.23.0, 0.24.0
    • Component/s: test
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      TestHttpServer passed but there were AssertionError in the output.

      11/08/30 03:35:56 INFO http.TestHttpServer: HTTP server started: http://localhost:52974/
      Exception in thread "pool-1-thread-61" java.lang.AssertionError: 
      	at org.junit.Assert.fail(Assert.java:91)
      	at org.junit.Assert.assertTrue(Assert.java:43)
      	at org.junit.Assert.assertTrue(Assert.java:54)
      	at org.apache.hadoop.http.TestHttpServer$1.run(TestHttpServer.java:164)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:680)
      
      1. HADOOP-7593.patch
        2 kB
        Uma Maheswara Rao G

        Activity

        Hide
        Uma Maheswara Rao G added a comment -

        Hi Nicholas,

        Just analysed the issue here.
        Assertion failures here because of max threads in HttpServer ThreadPool count.

        Test is expecting maxThreads count to be 10. But Confuguration was not set to 10. Default it is taking as -1.
        If configuration is -1, then QueuedThreadPool will take default value as 254.

           int maxThreads = conf.getInt(HTTP_MAX_THREADS, -1);
            // If HTTP_MAX_THREADS is not configured, QueueThreadPool() will use the
            // default value (currently 254).
            QueuedThreadPool threadPool = maxThreads == -1 ?
                new QueuedThreadPool() : new QueuedThreadPool(maxThreads);
            webServer.setThreadPool(threadPool);
        

        small note: I think real count is 250, but above comment says 254.

        Because of the above reason, the assertions are failing.

        I will set the configuration explicitly and post the patch.

        Thanks Nicholas for filing the Jira. Good observation

        Thanks
        Uma

        Show
        Uma Maheswara Rao G added a comment - Hi Nicholas, Just analysed the issue here. Assertion failures here because of max threads in HttpServer ThreadPool count. Test is expecting maxThreads count to be 10. But Confuguration was not set to 10. Default it is taking as -1. If configuration is -1, then QueuedThreadPool will take default value as 254. int maxThreads = conf.getInt(HTTP_MAX_THREADS, -1); // If HTTP_MAX_THREADS is not configured, QueueThreadPool() will use the // default value (currently 254). QueuedThreadPool threadPool = maxThreads == -1 ? new QueuedThreadPool() : new QueuedThreadPool(maxThreads); webServer.setThreadPool(threadPool); small note: I think real count is 250, but above comment says 254. Because of the above reason, the assertions are failing. I will set the configuration explicitly and post the patch. Thanks Nicholas for filing the Jira. Good observation Thanks Uma
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12492278/HADOOP-7593.patch
        against trunk revision .

        +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 appears to introduce 4 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 unit tests in hadoop-common-project.

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

        Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/104//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/104//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-auth.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/104//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-common.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/104//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-annotations.html
        Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/104//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/12492278/HADOOP-7593.patch against trunk revision . +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 appears to introduce 4 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 unit tests in hadoop-common-project. +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/104//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/104//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-auth.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/104//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-common.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/104//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-annotations.html Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/104//console This message is automatically generated.
        Hide
        Uma Maheswara Rao G added a comment -

        Find bug warnings are not related to this patch. They ate from Auth.

        Show
        Uma Maheswara Rao G added a comment - Find bug warnings are not related to this patch. They ate from Auth.
        Hide
        Tsz Wo Nicholas Sze added a comment -

        +1 patch looks good.

        Show
        Tsz Wo Nicholas Sze added a comment - +1 patch looks good.
        Hide
        Tsz Wo Nicholas Sze added a comment -

        I have committed this to 0.23 and trunk. Thanks, Uma!

        Show
        Tsz Wo Nicholas Sze added a comment - I have committed this to 0.23 and trunk. Thanks, Uma!
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk-Commit #889 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/889/)
        HADOOP-7593. Fix AssertionError in TestHttpServer.testMaxThreads(). Contributed by Uma Maheswara Rao G

        szetszwo : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1163465
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #889 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/889/ ) HADOOP-7593 . Fix AssertionError in TestHttpServer.testMaxThreads(). Contributed by Uma Maheswara Rao G szetszwo : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1163465 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-trunk-Commit #812 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/812/)
        HADOOP-7593. Fix AssertionError in TestHttpServer.testMaxThreads(). Contributed by Uma Maheswara Rao G

        szetszwo : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1163465
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java
        Show
        Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #812 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/812/ ) HADOOP-7593 . Fix AssertionError in TestHttpServer.testMaxThreads(). Contributed by Uma Maheswara Rao G szetszwo : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1163465 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk-Commit #822 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/822/)
        HADOOP-7593. Fix AssertionError in TestHttpServer.testMaxThreads(). Contributed by Uma Maheswara Rao G

        szetszwo : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1163465
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #822 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/822/ ) HADOOP-7593 . Fix AssertionError in TestHttpServer.testMaxThreads(). Contributed by Uma Maheswara Rao G szetszwo : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1163465 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk #778 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/778/)
        HADOOP-7593. Fix AssertionError in TestHttpServer.testMaxThreads(). Contributed by Uma Maheswara Rao G

        szetszwo : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1163465
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #778 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/778/ ) HADOOP-7593 . Fix AssertionError in TestHttpServer.testMaxThreads(). Contributed by Uma Maheswara Rao G szetszwo : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1163465 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk #802 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/802/)
        HADOOP-7593. Fix AssertionError in TestHttpServer.testMaxThreads(). Contributed by Uma Maheswara Rao G

        szetszwo : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1163465
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #802 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/802/ ) HADOOP-7593 . Fix AssertionError in TestHttpServer.testMaxThreads(). Contributed by Uma Maheswara Rao G szetszwo : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1163465 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java

          People

          • Assignee:
            Uma Maheswara Rao G
            Reporter:
            Tsz Wo Nicholas Sze
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development