Red Hat Bugzilla – Bug 1012140
KieSession.fireUntilHalt() consumes 100% CPU
Last modified: 2014-08-06 16:15:35 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):
Mac OS-X 1.8.5 + Hotspot JDK 1.7.0_40
RHEL 6.4 + OpenJDK 1.7.0_25
Fedora 18 + Java 6.
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
This case is the same as the following: https://issues.jboss.org/browse/DROOLS-272
The current fireUntilHalt() implementation is using a busy wait loop. We need to replace it by a wait/notify in the PathMemory.doLinkRule().
This is a blocker from engineering perspective.
+1 from QE.
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.
Edson Tirelli <firstname.lastname@example.org> updated the status of jira DROOLS-272 to Resolved
Edson Tirelli <email@example.com> updated the status of jira DROOLS-272 to Closed
Verified on BRMS 6.0.0.ER5.