Bug 1012140 - KieSession.fireUntilHalt() consumes 100% CPU
Summary: KieSession.fireUntilHalt() consumes 100% CPU
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: BRE
Version: 6.0.0
Hardware: All
OS: All
urgent
urgent
Target Milestone: ER5
: 6.0.0
Assignee: Edson Tirelli
QA Contact: Tomas David
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-25 19:46 UTC by Richard Bourner
Modified: 2014-08-06 20:15 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:15:35 UTC
Type: Bug
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker DROOLS-272 0 Blocker Closed KieSession.fireUntilHalt() consumes 100% CPU 2015-12-19 04:18:01 UTC

Description Richard Bourner 2013-09-25 19:46:10 UTC
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 19:54:50 UTC
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 13:40:08 UTC
This is a blocker from engineering perspective.

Comment 4 Lukáš Petrovický 2013-09-26 13:45:21 UTC
+1 from QE.

Comment 5 Edson Tirelli 2013-09-30 21:11:28 UTC
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-08 00:54:52 UTC
Edson Tirelli <ed.tirelli> updated the status of jira DROOLS-272 to Resolved

Comment 10 JBoss JIRA Server 2013-10-08 00:54:58 UTC
Edson Tirelli <ed.tirelli> updated the status of jira DROOLS-272 to Closed

Comment 12 Tomas David 2013-12-10 10:53:06 UTC
Verified on BRMS 6.0.0.ER5.


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