[
https://issues.jboss.org/browse/JBRULES-3528?page=com.atlassian.jira.plug...
]
RH Bugzilla Integration updated JBRULES-3528:
---------------------------------------------
Bugzilla References:
https://bugzilla.redhat.com/show_bug.cgi?id=851307
Deadlock when using pseudo session clock
----------------------------------------
Key: JBRULES-3528
URL:
https://issues.jboss.org/browse/JBRULES-3528
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-core (fusion)
Affects Versions: 5.3.0.Final, 5.4.0.Final
Reporter: Cyril Sochor
Assignee: Edson Tirelli
Labels: deadlock, fireuntilhalt, pseudoclock
Fix For: 5.5.0.Beta1
Attachments: PseudoClockEventsTest.java
Deadlock when using fireUntilHalt in one thread and PseudoClockScheduler.advanceTime() in
second thread.
Surroundings:
I read many events from JMS queue, each event has timestamp. I need temporal operations
measured by time in timestamps. E.g. SomeEvent() over window:time(10s) means events with
timestamps in interval 10s, not events inserted in interval 10s. So, I must use pseudo
session clock and advance time before event insert into statefull session. Sometimes
deadlock occured or NullPointerException is thrown.
I created test case.
Deadlock stacktraces:
Name: Thread-1
State: BLOCKED on org.drools.time.impl.PseudoClockScheduler@4599d5b owned by: Thread-0
Total blocked: 6 Total waited: 3
Stack trace:
org.drools.time.impl.PseudoClockScheduler.getCurrentTime(PseudoClockScheduler.java:104)
org.drools.common.AbstractWorkingMemory.endOperation(AbstractWorkingMemory.java:1345)
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1240)
- locked org.drools.common.DefaultAgenda@57e2793d
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1126)
org.drools.common.DefaultAgenda.fireUntilHalt(DefaultAgenda.java:1327)
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:754)
- locked org.drools.reteoo.ReteooStatefulSession@31d8d237
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:730)
org.drools.impl.StatefulKnowledgeSessionImpl.fireUntilHalt(StatefulKnowledgeSessionImpl.java:245)
org.drools.integrationtests.StreamsTest$1.run(StreamsTest.java:526)
java.lang.Thread.run(Thread.java:662)
Name: Thread-0
State: BLOCKED on org.drools.common.DefaultAgenda@57e2793d owned by: Thread-1
Total blocked: 2 Total waited: 0
Stack trace:
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1168)
org.drools.common.Scheduler$ActivationTimerJob.execute(Scheduler.java:86)
org.drools.time.impl.DefaultTimerJobInstance.call(DefaultTimerJobInstance.java:47)
org.drools.time.impl.DefaultTimerJobInstance.call(DefaultTimerJobInstance.java:1)
org.drools.time.impl.PseudoClockScheduler.runCallBacks(PseudoClockScheduler.java:203)
org.drools.time.impl.PseudoClockScheduler.advanceTime(PseudoClockScheduler.java:156)
- locked org.drools.time.impl.PseudoClockScheduler@4599d5b
org.drools.integrationtests.StreamsTest.processStocks(StreamsTest.java:533)
org.drools.integrationtests.StreamsTest.testEvenFirePseudoClockRulesAB(StreamsTest.java:500)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
org.junit.internal.runners.statements.FailOnTimeout$1.run(FailOnTimeout.java:28)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira