Bug 1012140 - KieSession.fireUntilHalt() consumes 100% CPU
KieSession.fireUntilHalt() consumes 100% CPU
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: BRE (Show other bugs)
All All
urgent Severity urgent
: ER5
: 6.0.0
Assigned To: Edson Tirelli
Tomas David
Depends On:
  Show dependency treegraph
Reported: 2013-09-25 15:46 EDT by Richard Bourner
Modified: 2014-08-06 16:15 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-08-06 16:15:35 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Maven Eclipse project demonstrating the issue (21.68 KB, application/x-zip-compressed)
2013-09-25 15:46 EDT, Richard Bourner
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker DROOLS-272 Blocker Closed KieSession.fireUntilHalt() consumes 100% CPU 2015-12-18 23:18 EST

  None (edit)
Description Richard Bourner 2013-09-25 15:46:10 EDT
Created attachment 803047 [details]
Maven Eclipse project demonstrating the issue

Description of problem:
When we run a KieSession.fireUntilHalt(), our application starts consuming 100% CPU, without anything actually happening inside the app (no events/facts are being inserted, no rules are activated/fired, etc.). We've tested this on multiple machines, different OSs, different JDKs, etc., and they all show the same behaviour.

Version-Release number of selected component (if applicable):
Drools 6.0.0.CR3
Mac OS-X 1.8.5 + Hotspot JDK 1.7.0_40
RHEL 6.4 + OpenJDK 1.7.0_25
Fedora 18 + Java 6.

How reproducible:
A small test demonstrating the problem has been created. 
The test loads a simple DRL via KieClasspathContainer, retrieves a new KieSession and runs a KieSession.fireUntilHalt() in a separate thread. 
After launching the thread, we let the main thread sleep for 30 seconds (3 * 10) and during this time period, CPU load increases to 100%. 
We then halt the session and sleep for another 10 seconds, which causes the CPU load to back to normal.

Steps to Reproduce:
1. run 'mvn clean test' on the project
2. monitor the CPU load on your system

Actual results:

Expected results:

Additional info:
This case is the same as the following: https://issues.jboss.org/browse/DROOLS-272
Comment 2 Edson Tirelli 2013-09-25 15:54:50 EDT
The current fireUntilHalt() implementation is using a busy wait loop. We need to replace it by a wait/notify in the PathMemory.doLinkRule().
Comment 3 Edson Tirelli 2013-09-26 09:40:08 EDT
This is a blocker from engineering perspective.
Comment 4 Lukáš Petrovický 2013-09-26 09:45:21 EDT
+1 from QE.
Comment 5 Edson Tirelli 2013-09-30 17:11:28 EDT
Just an update, I fixed the 100% CPU problem in a local branch, but that broke a list of other tests. I've been going through each of those tests and fixing the side effects of the code changes. I will keep you posted.
Comment 9 JBoss JIRA Server 2013-10-07 20:54:52 EDT
Edson Tirelli <ed.tirelli@gmail.com> updated the status of jira DROOLS-272 to Resolved
Comment 10 JBoss JIRA Server 2013-10-07 20:54:58 EDT
Edson Tirelli <ed.tirelli@gmail.com> updated the status of jira DROOLS-272 to Closed
Comment 12 Tomas David 2013-12-10 05:53:06 EST
Verified on BRMS 6.0.0.ER5.

Note You need to log in before you can comment on or make changes to this bug.