You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org> on 2011/08/30 14:31:37 UTC

[jira] [Commented] (HADOOP-7593) AssertionError in TestHttpServer.testMaxThreads()

    [ https://issues.apache.org/jira/browse/HADOOP-7593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13093682#comment-13093682 ] 

Uma Maheswara Rao G commented on HADOOP-7593:
---------------------------------------------

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.

{code}
   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);
{code}

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

> AssertionError in TestHttpServer.testMaxThreads()
> -------------------------------------------------
>
>                 Key: HADOOP-7593
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7593
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Tsz Wo (Nicholas), SZE
>
> TestHttpServer passed but there were AssertionError in the output.
> {noformat}
> 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)
> {noformat}
> 	

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira