[jboss-jira] [JBoss JIRA] (JBAS-8595) Thread Pooling configuration from jmx-console doesn't update WorkerStack size. Size remains 200 always.
Eduardo Silva (JIRA)
jira-events at lists.jboss.org
Thu May 3 14:30:18 EDT 2012
[ https://issues.jboss.org/browse/JBAS-8595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12690186#comment-12690186 ]
Eduardo Silva commented on JBAS-8595:
-------------------------------------
This bug is related to JBOSS WEB project , jbossweb.jar
The inner class WorkerStack located in the org.apache.tomcat.util.net.JIoEndpoint
The WorkerStack class has not any code to resize the workers array.
And it is instanced once when executor is null in the JIoEndpoint class, so it does not care about the number
// Create worker collection
if (executor == null) {
workers = new WorkerStack(maxThreads);
}
So even whe the max number of Threads increase ...
/**
* Maximum amount of worker threads.
*/
protected int maxThreads = 200;
public void setMaxThreads(int maxThreads) { this.maxThreads = maxThreads; }
public int getMaxThreads() { return maxThreads; }
..the Worker will still at the same size,
The WorkerStack inner class is replicated in org.apache.tomcat.util.net.AprEndpoint and org.apache.tomcat.util.net.JIoEndpoint and I verified that it was removed in the apache-tomcat-7.0.27 org.apache.tomcat.util.net.JIoEndpoint class, but it still in jboss-web-3.0 project.
So a patch is needed to change to WorkerStack class
public void setMaxThreads(int maxThreads) {
this.maxThreads = maxThreads;
workers.resizeTo(maxThreads); // new method implementation required at the WorkerStack inner class , the changes should be replicated to AprEndpoint as well
}
> Thread Pooling configuration from jmx-console doesn't update WorkerStack size. Size remains 200 always.
> -------------------------------------------------------------------------------------------------------
>
> Key: JBAS-8595
> URL: https://issues.jboss.org/browse/JBAS-8595
> Project: Application Server 3 4 5 and 6
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Web Console
> Affects Versions: JBossAS-5.0.1.GA
> Environment: Windows/Linux, JDK1.5, RAM 2GB, Processor 3GHz, Intel Core Due CPU
> Reporter: Nishant Parikh
> Priority: Critical
> Fix For: No Release
>
>
> When we fire concurrent request more than 200, let's say 200+x (With maxThreads specified 1000 from jmx/web console), Everything works fine but after few seconds x NUMBER OF THREADS GETS BUSY and they never get free. On server log we are getting below ArrayIndexOutOfBoundsException.
> Exception in thread "http-192.168.1.166-8080-4" java.lang.ArrayIndexOutOfBoundsException: 200
> at org.apache.tomcat.util.net.JIoEndpoint$WorkerStack.push(JIoEndpoint.java:769)
> at org.apache.tomcat.util.net.JIoEndpoint.recycleWorkerThread(JIoEndpoint.java:724)
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:457)
> at java.lang.Thread.run(Thread.java:662)
> Exception in thread "http-192.168.1.166-8080-16" java.lang.ArrayIndexOutOfBoundsException: 201
> at org.apache.tomcat.util.net.JIoEndpoint$WorkerStack.push(JIoEndpoint.java:769)
> at org.apache.tomcat.util.net.JIoEndpoint.recycleWorkerThread(JIoEndpoint.java:724)
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:457)
> at java.lang.Thread.run(Thread.java:662)
> Exception in thread "http-192.168.1.166-8080-91" java.lang.ArrayIndexOutOfBoundsException: 202
> at org.apache.tomcat.util.net.JIoEndpoint$WorkerStack.push(JIoEndpoint.java:769)
> at org.apache.tomcat.util.net.JIoEndpoint.recycleWorkerThread(JIoEndpoint.java:724)
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:457)
> at java.lang.Thread.run(Thread.java:662)
> Exception in thread "http-192.168.1.166-8080-98" java.lang.ArrayIndexOutOfBoundsException: 203
> at org.apache.tomcat.util.net.JIoEndpoint$WorkerStack.push(JIoEndpoint.java:769)
> at org.apache.tomcat.util.net.JIoEndpoint.recycleWorkerThread(JIoEndpoint.java:724)
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:457)
> at java.lang.Thread.run(Thread.java:662)
> 17:08:49,515 ERROR [JIoEndpoint] Error allocating socket processor
> java.lang.ArrayIndexOutOfBoundsException: 203
> at org.apache.tomcat.util.net.JIoEndpoint$WorkerStack.pop(JIoEndpoint.java:778)
> at org.apache.tomcat.util.net.JIoEndpoint.createWorkerThread(JIoEndpoint.java:661)
> at org.apache.tomcat.util.net.JIoEndpoint.getWorkerThread(JIoEndpoint.java:702)
> at org.apache.tomcat.util.net.JIoEndpoint.processSocket(JIoEndpoint.java:737)
> at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:313)
> at java.lang.Thread.run(Thread.java:662)
> 17:08:49,530 ERROR [JIoEndpoint] Error allocating socket processor
> java.lang.ArrayIndexOutOfBoundsException: 202
> at org.apache.tomcat.util.net.JIoEndpoint$WorkerStack.pop(JIoEndpoint.java:778)
> at org.apache.tomcat.util.net.JIoEndpoint.createWorkerThread(JIoEndpoint.java:661)
> at org.apache.tomcat.util.net.JIoEndpoint.getWorkerThread(JIoEndpoint.java:702)
> at org.apache.tomcat.util.net.JIoEndpoint.processSocket(JIoEndpoint.java:737)
> at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:313)
> at java.lang.Thread.run(Thread.java:662)
> 17:08:49,546 ERROR [JIoEndpoint] Error allocating socket processor
> java.lang.ArrayIndexOutOfBoundsException: 201
> at org.apache.tomcat.util.net.JIoEndpoint$WorkerStack.pop(JIoEndpoint.java:778)
> at org.apache.tomcat.util.net.JIoEndpoint.createWorkerThread(JIoEndpoint.java:661)
> at org.apache.tomcat.util.net.JIoEndpoint.getWorkerThread(JIoEndpoint.java:702)
> at org.apache.tomcat.util.net.JIoEndpoint.processSocket(JIoEndpoint.java:737)
> at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:313)
> at java.lang.Thread.run(Thread.java:662)
> 17:08:49,548 ERROR [JIoEndpoint] Error allocating socket processor
> java.lang.ArrayIndexOutOfBoundsException: 200
> at org.apache.tomcat.util.net.JIoEndpoint$WorkerStack.pop(JIoEndpoint.java:778)
> at org.apache.tomcat.util.net.JIoEndpoint.createWorkerThread(JIoEndpoint.java:661)
> at org.apache.tomcat.util.net.JIoEndpoint.getWorkerThread(JIoEndpoint.java:702)
> at org.apache.tomcat.util.net.JIoEndpoint.processSocket(JIoEndpoint.java:737)
> at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:313)
> at java.lang.Thread.run(Thread.java:662)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list