Bug 1089075

Summary: Race condition in QueuelessExecutor leads to task execution delays
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Aaron Ogburn <aogburn>
Component: OtherAssignee: Jason Greene <jason.greene>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Svehla <msvehla>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.3.0CC: david.lloyd, kkhan, lthon, msvehla
Target Milestone: DR8   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:
Bug Depends On: 1159002    
Bug Blocks:    

Description Aaron Ogburn 2014-04-17 20:31:44 UTC
Description of problem:

Queueless executor has a race condition that can lead to severe delays in between the time that a waitingWorker is assigned a task and the time that it is actually signaled so that it can start executing that task. This has been seen to lead to hangs of 30 minutes or more in a simple request that processes for less than 1 second.

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

Jboss Threads 2.1.1.Final


How reproducible:

Very


Steps to Reproduce:
1. Configure a queueless executor for the http connector:

                <blocking-queueless-thread-pool name="HTTP">
                    <max-threads count="400"/>
                    <keepalive-time time="1" unit="hours"/>
                    <thread-factory name="http-connector-factory"/>
                </blocking-queueless-thread-pool>
    ...
                <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" executor="HTTP"/>

2. Run JBoss with no keepalive. This helps lighter request traffic cause workers to loop through waiting states more quickly.

    -Dorg.apache.coyote.http11.Http11Protocol.MAX_KEEP_ALIVE_REQUESTS=1

3. Load JBoss up with requests (even just holding ctrl+R for about 10 seconds or so on my browser appears to be enough to hit this with keepalive off)
4. Check thread dumps for multiple Worker threads waiting on taskEnqueued (typically line 651)

Actual results:

Multiple threads end up waiting on taskEnqueued at once, which can cause delays as an execute() call signals the wrong worker.

Expected results:

There is onlly ever one worker waiting on taskEnqueued

Comment 1 JBoss JIRA Server 2014-06-25 14:34:41 UTC
David Lloyd <david.lloyd> updated the status of jira JBTHR-27 to Resolved

Comment 2 Martin Svehla 2014-08-11 11:20:08 UTC
Moving target to 6.4.0, since the 6.3.0 contains jboss-threads tag 2.1.1 without this fix.

Comment 5 Kabir Khan 2014-10-29 23:33:39 UTC
David, I think it looks like this will be in JBoss Threads 2.1.2?

Comment 6 Ladislav Thon 2014-11-14 10:38:57 UTC
Verified with EAP 6.4.0.DR9.

Verification note: the "taskEnqueued" word is not visible in the stacktrace. "Check thread dumps for multiple Worker threads waiting on taskEnqueued (typically line 651)" means "look for org.jboss.threads.QueuelessExecutor$Worker.run(QueuelessExecutor.java:651)".