Bug 1231070

Summary: [GSS](6.4.z) ArrayIndexOutOfBoundsException occurs when a queue-length is 0 in the thread pool executor
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Eiichi Nagai <enagai>
Component: WebAssignee: Petr Jurak <pjurak>
Status: CLOSED WONTFIX QA Contact: Radim Hatlapatka <rhatlapa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4.1CC: bmaxwell, brian.stansberry, egonzale, jtruhlar, pjurak, ppalaga, rmaucher
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-27 16:38:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Eiichi Nagai 2015-06-12 06:34:12 UTC
Description of problem:
ArrayIndexOutOfBoundsException occurs when a queue-length is 0 in the thread pool executor.

Exception in thread "testTP-threads - 1" java.lang.ArrayIndexOutOfBoundsException: 0
	at org.jboss.threads.ArrayQueue.poll(ArrayQueue.java:118)
	at org.jboss.threads.QueueExecutor.takeTask(QueueExecutor.java:713)
	at org.jboss.threads.QueueExecutor.access$400(QueueExecutor.java:45)
	at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:842)
	at java.lang.Thread.run(Thread.java:745)
	at org.jboss.threads.JBossThread.run(JBossThread.java:122)


Version-Release number of selected component (if applicable):
EAP 6.4.1

Steps to Reproduce:
1. Set the thread pool executor.
~~~
[standalone@localhost:9999 /] /subsystem=threads/bounded-queue-thread-pool=testTP:add(max-threads=10, queue-length=0)
{"outcome" => "success"}
[standalone@localhost:9999 /] /subsystem=web/connector=http:write-attribute(name=executor,value=testTP)
{
    "outcome" => "success",
    "response-headers" => {
        "operation-requires-reload" => true,
        "process-state" => "reload-required"
    }
}
[standalone@localhost:9999 /] reload
~~~

2. Execute "http://localhost:8080/" in your browser.

3. You can confirm the ArrayIndexOutOfBoundsException in your server log.

Comment 1 Petr Jurak 2016-10-19 13:31:08 UTC
PR https://github.com/jbossas/jboss-eap/pull/2863

Comment 2 JBoss JIRA Server 2016-10-19 13:48:12 UTC
Petr Jurak <pjurak> updated the status of jira WFCORE-773 to Coding In Progress

Comment 6 Petr Jurak 2016-10-21 06:00:14 UTC
Due to my repo clean up I had to create a new PR:
https://github.com/jbossas/jboss-eap/pull/2865

Comment 11 Peter Palaga 2016-10-27 16:38:31 UTC
Closing as WONTFIX because Brian sees the proposed fix as changing the described management API of the jca and threads subsystems, which makes it not a good candidate for a CP.