[
https://jira.jboss.org/jira/browse/JBRULES-2375?page=com.atlassian.jira.p...
]
Paul O'Riordan commented on JBRULES-2375:
-----------------------------------------
What appears to be happening is that:
The insert and retract methods of the NamedEntryPoint class are both synchronized via a
reentrant lock "lock". Both of these methods also require synchronized access
to the actionQueue from AbstractWorkingMemory via various methods.
When the AbstractWorkingMemory.executeQueuedActions() method (synchronized on
actionQueue) is called, it executes the actions in the queue, if one of these actions is
an ExpiredJob, it will trigger a retract. This method is called from fireUntilHalt (among
other places) which do not synchronize on the lock in NamedEntryPoint.
The situation where deadlock occurs is as follows:
1) Insert method obtains NamedEntryPoint lock.
2) fireUntilHalt's thread obtains the lock in executeQueuedActions.
3) executeQueuedActions executes an ExpiredJob action, which calls
NamedEntryPoint.retract
4) The retract method is waiting on the NamedEntryPoint lock to be released, which cannot
be released
because the thread which is holding it is waiting for the lock on actionQueue to be
released (held by
fireUntilHalt's thread)
Drools hangs when events are retracted
--------------------------------------
Key: JBRULES-2375
URL:
https://jira.jboss.org/jira/browse/JBRULES-2375
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-core (fusion)
Affects Versions: 5.0.1.FINAL
Environment: Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Microsoft Windows XP [Version 5.1.2600]
Intel (R) Xeon (R) CPU E5405 @ 2.00GHz (Quad Core)
Reporter: Paul O'Riordan
Assignee: Edson Tirelli
Priority: Blocker
Fix For: 5.1.0.M2
Attachments: Main.java, stacktrace.txt
Using a StatefulKnowledgeSession (stream mode). Drools hangs when events are retracted
from the session. Running the attached code results in drools hanging almost immediately.
Adding the @expires property to the event declaration, e.g.
declare Foo
@role (event)
@expires (10s)
end
causes drools to hang after the specified expiry time, i.e. 10 seconds.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira