[
https://jira.jboss.org/jira/browse/JBRULES-2125?page=com.atlassian.jira.p...
]
Jonathon Leibundguth commented on JBRULES-2125:
-----------------------------------------------
Think I've found something similar, but wasn't sure whether to add as a new issue
- I had believed it might be the same as 2114, possibly like this one, however, it may be
unique. I don't currently have a unit test for this, we would have too much code to
upload to show it right now -- but detected deadlock was using jconsole between 3
threads:
thread 1, called "droolsFireUntilHalt" is attempting to expire an object/fact
while running fireUntilHalt()
thread 2, called "pool-2-thread-1", is an internal drools thread and its running
a timer (defined in a .rf file) that injects a fact every 2 seconds to kick off rules --
it blocks on that insert() on working memory
thread 3, called "jpCapSensorThread", is inserting objects into a stream / named
entry point - it also blocks on insert(), this time on a named entry point.
Below are the traces from these threads:
Name: droolsFireUntilHalt
State: WAITING on java.util.concurrent.locks.ReentrantLock$NonfairSync@1def658 owned by:
jpCapSensorThread
Total blocked: 293 Total waited: 293
Stack trace:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:778)
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1114)
java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262)
org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:258)
org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:245)
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteExpireAction.execute(ReteooWorkingMemory.java:350)
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1486)
- locked java.util.LinkedList@e707bb
org.drools.common.DefaultAgenda.fireUntilHalt(DefaultAgenda.java:1067)
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:701)
- locked org.drools.reteoo.ReteooStatefulSession@14fa79d
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:678)
- locked org.drools.reteoo.ReteooStatefulSession@14fa79d
org.drools.impl.StatefulKnowledgeSessionImpl.fireUntilHalt(StatefulKnowledgeSessionImpl.java:195)
---------
Name: pool-2-thread-1
State: BLOCKED on java.util.LinkedList@e707bb owned by: droolsFireUntilHalt
Total blocked: 1 Total waited: 296
Stack trace:
org.drools.common.AbstractWorkingMemory.queueWorkingMemoryAction(AbstractWorkingMemory.java:1509)
org.drools.reteoo.ObjectTypeNode$ExpireJob.execute(ObjectTypeNode.java:443)
org.drools.time.impl.JDKTimerService$JDKCallableJob.call(JDKTimerService.java:132)
org.drools.time.impl.JDKTimerService$JDKCallableJob.call(JDKTimerService.java:110)
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
java.util.concurrent.FutureTask.run(FutureTask.java:138)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:619)
--------
Name: jpCapSensorThread
State: BLOCKED on java.util.LinkedList@e707bb owned by: droolsFireUntilHalt
Total blocked: 4 Total waited: 0
Stack trace:
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1479)
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:158)
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:122)
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80)
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28)
com.raytheon.nsff.spi.jpcap.DNSPacketInjector.receivePacket(DNSPacketInjector.java:23)
jpcap.JpcapCaptor.loopPacket(Native Method)
com.raytheon.nsff.spi.jpcap.JPCapSPIImpl$1.run(JPCapSPIImpl.java:98)
java.lang.Thread.run(Thread.java:619)
Drools core multithreading issue
--------------------------------
Key: JBRULES-2125
URL:
https://jira.jboss.org/jira/browse/JBRULES-2125
Project: JBoss Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-core
Affects Versions: 5.0.1.FINAL
Environment: Java HotSpot v 1.6.0_06, WinXP SP3
Reporter: Andrey Nechaev
Assignee: Edson Tirelli
Attachments: Main.java
Attachement below is the code showing the problems.
The program hangs and nothing is displayed in the Console.
If I put lines 10-11 before the line 6, I get a NullPointerException:
Exception in thread "main" java.lang.NullPointerException
at org.drools.reteoo.ObjectSource.addObjectSink(ObjectSource.java:124)
...
But, if I comment out the lines 2&3, everything works ok.
--
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