<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 18/08/2010 00:49, Norman C wrote:
<blockquote cite="mid:398317.3490.qm@web45316.mail.sp1.yahoo.com"
type="cite">
<style type="text/css"><!-- DIV {margin:0px;} --></style>
<div style="font-family: times new roman,new york,times,serif;
font-size: 12pt;">
<div> </div>
<div>Hi All,</div>
<div> </div>
<div>I've posted on this topic twice and logged a JIRA ticket (<a
moz-do-not-send="true"
href="https://jira.jboss.org/browse/JBRULES-2651">https://jira.jboss.org/browse/JBRULES-2651</a>)
as well. I've received no responses and the bug hasn't been
updated since I logged it.</div>
</div>
</blockquote>
I just replied to the jira. I'm committing the fix now.<br>
<br>
Mark<br>
<blockquote cite="mid:398317.3490.qm@web45316.mail.sp1.yahoo.com"
type="cite">
<div style="font-family: times new roman,new york,times,serif;
font-size: 12pt;">
<div> </div>
<div>This is a serious issue as it causes my production system
to freeze up and it has to be restarted. It's consistently
reproducible (usually takes a few days). <br>
</div>
<div>Can someone please take a quick look at the code? Does the
call to SingleThreadedObjectStore.addHandle in
NamedEntryPoint.insert need to be preceded by acquiring the
lock?</div>
<div> </div>
<div>Thanks again for your help.</div>
<div> </div>
<div>Norman</div>
<div style="font-family: times new roman,new york,times,serif;
font-size: 12pt;"><br>
<div style="font-family: times new roman,new york,times,serif;
font-size: 12pt;"><font face="Tahoma" size="2">
<hr size="1">
<b><span style="font-weight: bold;">From:</span></b>
Norman C <a class="moz-txt-link-rfc2396E" href="mailto:rent_my_time@yahoo.com"><rent_my_time@yahoo.com></a><br>
<b><span style="font-weight: bold;">To:</span></b>
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<b><span style="font-weight: bold;">Sent:</span></b> Wed,
August 4, 2010 11:23:55 PM<br>
<b><span style="font-weight: bold;">Subject:</span></b>
Re: Possible concurrency issue in Drools<br>
</font><br>
<div style="font-family: times new roman,new
york,times,serif; font-size: 12pt;">
<div> </div>
<div>I've run into this issue a few more times. Should I
log a JIRA ticket for this? Any advice would be
appreciated.</div>
<div> </div>
<div>Thanks,</div>
<div>Norman<br>
</div>
<div style="font-family: times new roman,new
york,times,serif; font-size: 12pt;"><br>
<div style="font-family: times new roman,new
york,times,serif; font-size: 12pt;"><font
face="Tahoma" size="2">
<hr size="1">
<b><span style="font-weight: bold;">From:</span></b>
Norman C <a class="moz-txt-link-rfc2396E" href="mailto:rent_my_time@yahoo.com"><rent_my_time@yahoo.com></a><br>
<b><span style="font-weight: bold;">To:</span></b>
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<b><span style="font-weight: bold;">Sent:</span></b>
Sat, July 31, 2010 9:56:26 PM<br>
<b><span style="font-weight: bold;">Subject:</span></b>
Re: Possible concurrency issue in Drools<br>
</font><br>
<div style="font-family: times new roman,new
york,times,serif; font-size: 12pt;">
<div> </div>
<div>All,</div>
<div> </div>
<div>Just wanted to mention, I'm using version 5.0.1
of Drools.</div>
<div> </div>
<div>Thanks,</div>
<div>Norman<br>
</div>
<div style="font-family: times new roman,new
york,times,serif; font-size: 12pt;"><br>
<div style="font-family: times new roman,new
york,times,serif; font-size: 12pt;"><font
face="Tahoma" size="2">
<hr size="1">
<b><span style="font-weight: bold;">From:</span></b>
Norman C <a class="moz-txt-link-rfc2396E" href="mailto:rent_my_time@yahoo.com"><rent_my_time@yahoo.com></a><br>
<b><span style="font-weight: bold;">To:</span></b>
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<b><span style="font-weight: bold;">Sent:</span></b>
Sat, July 31, 2010 9:50:19 PM<br>
<b><span style="font-weight: bold;">Subject:</span></b>
Possible concurrency issue in Drools<br>
</font><br>
<div style="font-family: times new roman,new
york,times,serif; font-size: 12pt;">
<div> </div>
<div>Hi All,</div>
<div> </div>
<div>I recently ran into an issue which I
believe might point to a concurrency issue.
My server stopped processing new requests,
so I did a thread dump. In examining the
dump, I found that all of the processing
threads, save two, were blocking while
trying to acquire the lock in
NamedEntryPoint.insert. Both of the other
two threads appeared to be infinitely
looping in the NamedEntryPoint.insert
method. Here are snippets of the stack
traces:</div>
<div> </div>
<div><span style="font-family: 'Courier New';
font-size: 11pt;">ActiveMQ Session Task"
prio=10 tid=0x00002aab0003b000 nid=0x7b98
runnable
[0x000000004c086000..0x000000004c087c90]
java.lang.Thread.State: RUNNABLE at
org.drools.util.ObjectHashMap.remove(ObjectHashMap.java:121)
at
org.drools.common.SingleThreadedObjectStore.removeHandle(SingleThreadedObjectStore.java:150)
at
org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:296)
at
org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:245)
at
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteExpireAction.execute(ReteooWorkingMemory.java:350)
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1488)
at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:158)
at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:122)
at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80)
at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28)
at </span></div>
<div><span style="font-family: 'Courier New';
font-size: 11pt;"></span> </div>
<div><span style="font-family: 'Courier New';
font-size: 11pt;"><span
style="font-family: 'Courier New';
font-size: 11pt;">ActiveMQ Session Task"
prio=10 tid=0x000000005a35cc00 nid=0xdf6
runnable
[0x000000004a268000..0x000000004a269a90]
java.lang.Thread.State: RUNNABLE at
org.drools.util.AbstractHashTable.resize(AbstractHashTable.java:115)
at
org.drools.util.ObjectHashMap.put(ObjectHashMap.java:78)
at
org.drools.common.SingleThreadedObjectStore.addHandle(SingleThreadedObjectStore.java:136)
at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:113)
at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80)
at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28)
at </span></span></div>
<div><span style="font-family: 'Courier New';
font-size: 11pt;"><span
style="font-family: 'Courier New';
font-size: 11pt;"></span></span> </div>
<div><span style="font-family: 'Courier New';
font-size: 11pt;"><span
style="font-family: 'Courier New';
font-size: 11pt;"><font face="Times New
Roman" size="3">So it seems like one
while the first thread is holding the
lock and is attempting to remove an
object handle from the object store in
NamedEntryPoint, the other thread is
trying to resize that same object
store in response to an addHandle call
that puts it over the threshold. I
haven't worked out exactly how these
concurrent accesses to the same object
store by two different threads causes
an infinite loop in both threads, but
it seems like the call to
SingleThreadedObjectStore.addHandle
should be preceded by acquiring the
lock.</font></span></span></div>
<div><span style="font-family: 'Courier New';
font-size: 11pt;"><span
style="font-family: 'Courier New';
font-size: 11pt;"></span></span> </div>
<div><span style="font-family: 'Courier New';
font-size: 11pt;"><span
style="font-family: 'Courier New';
font-size: 11pt;"><font face="Times New
Roman" size="3">Is this correct? I
can imagine that resizing a large hash
map could potentially take a long time
and thus synchronizing this call could
impact performance, but somehow, the
action of resizing the table must be
protected in some way from adversely
impacting other operations on the
table.</font></span></span></div>
<div><span style="font-family: 'Courier New';
font-size: 11pt;"><span
style="font-family: 'Courier New';
font-size: 11pt;"></span></span> </div>
<div><span style="font-family: 'Courier New';
font-size: 11pt;"><span
style="font-family: 'Courier New';
font-size: 11pt;"><font face="Times New
Roman" size="3">Any help would be
appreciated.</font></span></span></div>
<div><span style="font-family: 'Courier New';
font-size: 11pt;"><span
style="font-family: 'Courier New';
font-size: 11pt;"></span></span> </div>
<div><span style="font-family: 'Courier New';
font-size: 11pt;"><span
style="font-family: 'Courier New';
font-size: 11pt;"><font face="Times New
Roman" size="3">thanks,</font></span></span></div>
<div><span style="font-family: 'Courier New';
font-size: 11pt;"><span
style="font-family: 'Courier New';
font-size: 11pt;"><font face="Times New
Roman" size="3">Norman</font></span></span></div>
<div><span style="font-family: 'Courier New';
font-size: 11pt;"><span
style="font-family: 'Courier New';
font-size: 11pt;"></span></span> </div>
</div>
<br>
</div>
</div>
</div>
<br>
</div>
</div>
</div>
<br>
</div>
</div>
</div>
<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</body>
</html>