[JBoss JIRA] Created: (JBRULES-607) Working memory is not disposed when releasing the RuleSession
by Einat Idan (JIRA)
Working memory is not disposed when releasing the RuleSession
-------------------------------------------------------------
Key: JBRULES-607
URL: http://jira.jboss.com/jira/browse/JBRULES-607
Project: JBoss Rules
Issue Type: Patch
Security Level: Public (Everyone can see)
Components: JSR94
Affects Versions: 3.0.1
Reporter: Einat Idan
Assigned To: Mark Proctor
Under heavy load conditions I encountered high cpu and hangs of the system. A thread dump shows all threads being stuck in
java.util.WeakHashMap, which is called from AbstractRuleBase.addWorkingMemory (please refer to linked thread).
After digging into the code it turned out that the client session object (AbstractRuleSessionImpl) has a release method. This method is supposed to releases all resources used by this rule session. And so it sets the properties, the working memory and the RuleExecutionSet to null:
public void release() {
this.setProperties( null );
this.setWorkingMemory( null );
this.setRuleExecutionSet( null );
}
However, it does NOT dispose the working memory as expected.
I added the following line to method:
getWorkingMemory().dispose();
Afterwards things improved significantly.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 5 months
[JBoss JIRA] Created: (JBRULES-611) ArrayIndexOutOfBoundsException when creating / executing rules
by Tomer Cohen (JIRA)
ArrayIndexOutOfBoundsException when creating / executing rules
--------------------------------------------------------------
Key: JBRULES-611
URL: http://jira.jboss.com/jira/browse/JBRULES-611
Project: JBoss Rules
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: All
Affects Versions: 3.0.5, 3.0.1
Reporter: Tomer Cohen
Assigned To: Mark Proctor
When creating the following rule:
rule forwardRequest
//no-loop true
when
exists(RulesFact(fact == Facts.PC_STATUS_UPDATED))
exists(RulesFact(fact == Facts.PC_DISABLED)) || exists(RulesFact(fact == Facts.PERFORMED_REQUEST_PC))
not(RulesFact(fact == Facts.REQUEST_DENIED))
not(ClientHttpResponse())
not(RulesFact(fact == Facts.ABORT_REQUEST_ERROR))
then
operationsInvoker.invokeOperation("com.flash.http.proxy.impls.operations.executeRequest.ExecuteRequestOperation",context);
assert(new RulesFact(Facts.REQUEST_FORWARDED_TO_THE_INTERNET));
end
The following exception is thrown:
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at org.drools.reteoo.FactHandleList.get(Unknown Source)
at org.drools.reteoo.TupleKey.get(Unknown Source)
at org.drools.reteoo.ReteTuple.get(Unknown Source)
at org.drools.reteoo.RightInputAdapterNode.assertTuple(Unknown Source)
at org.drools.reteoo.TupleSource.propagateAssertTuple(Unknown Source)
at org.drools.reteoo.NotNode.assertTuple(Unknown Source)
at org.drools.reteoo.LeftInputAdapterNode.createAndAssertTuple(Unknown Source)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(Unknown Source)
at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
at org.drools.reteoo.ObjectTypeNode.assertObject(Unknown Source)
at org.drools.reteoo.Rete.assertObject(Unknown Source)
at org.drools.reteoo.ReteooRuleBase.assertObject(Unknown Source)
at org.drools.reteoo.ReteooRuleBase.newWorkingMemory(Unknown Source)
at org.drools.common.AbstractRuleBase.newWorkingMemory(Unknown Source)
at org.drools.jsr94.rules.admin.RuleExecutionSetImpl.newWorkingMemory(Unknown Source)
at org.drools.jsr94.rules.AbstractRuleSessionImpl.newWorkingMemory(Unknown Source)
at org.drools.jsr94.rules.AbstractRuleSessionImpl.initWorkingMemory(Unknown Source)
at org.drools.jsr94.rules.StatefulRuleSessionImpl.<init>(Unknown Source)
at org.drools.jsr94.rules.RuleRuntimeImpl.createRuleSession(Unknown Source)
at com.flash.ruleEngine.RulesSessionFactoryImpl.createStatefulRuleSession(RulesSessionFactoryImpl.java:55)
Moving the condition with the | in it, the rules are compiled fine, but during the execution of the rules, the consequence of the following rule fails:
rule updateTransactionInfo
when
exists(RulesFact(fact == Facts.USER_DATA_UPDATED))
then
operationsInvoker.invokeOperation("com.flash.http.proxy.impls.operations.updateTransaction.UpdateTransactionInfoOperation",context);
assert(new RulesFact(Facts.TRANSACTIONS_DATA_UPDATED));
end
With the exception:
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at org.drools.reteoo.FactHandleList.get(Unknown Source)
at org.drools.reteoo.TupleKey.get(Unknown Source)
at org.drools.reteoo.ReteTuple.get(Unknown Source)
at org.drools.reteoo.RightInputAdapterNode.assertTuple(Unknown Source)
at org.drools.reteoo.TupleSource.propagateAssertTuple(Unknown Source)
at org.drools.reteoo.NotNode.assertTuple(Unknown Source)
at org.drools.reteoo.TupleSource.propagateAssertTuple(Unknown Source)
at org.drools.reteoo.NotNode.retractObject(Unknown Source)
at org.drools.reteoo.ObjectSource.propagateRetractObject(Unknown Source)
at org.drools.reteoo.RightInputAdapterNode.retractTuple(Unknown Source)
at org.drools.reteoo.TupleSource.propagateRetractTuple(Unknown Source)
at org.drools.reteoo.NotNode.assertObject(Unknown Source)
at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
at org.drools.reteoo.AlphaNode.assertObject(Unknown Source)
at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
at org.drools.reteoo.ObjectTypeNode.assertObject(Unknown Source)
at org.drools.reteoo.Rete.assertObject(Unknown Source)
at org.drools.reteoo.ReteooRuleBase.assertObject(Unknown Source)
at org.drools.reteoo.ReteooWorkingMemory.doAssertObject(Unknown Source)
at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
at org.drools.base.DefaultKnowledgeHelper.assertObject(Unknown Source)
at org.drools.base.DefaultKnowledgeHelper.assertObject(Unknown Source)
at com.flash.httpProxy.Rule_updateTransactionInfo_0.consequence(Rule_updateTransactionInfo_0.java:13)
at com.flash.httpProxy.Rule_updateTransactionInfo_0ConsequenceInvoker.evaluate(Rule_updateTransactionInfo_0ConsequenceInvoker.java:20)
I have this issue with version 3.0.1, upgrading to version 3.0.5 did not solve this issue.
I have looked through the site and found the following jira :
http://jira.jboss.org/jira/browse/JBRULES-183;jsessionid=794BA6EAA2A791F1...
Which seems to be talking about the same problem, however it was supposed to be fixed on 3.0 RC2 , so i am not sure if the issues are related.
If you need any more details, please let me know.
thanks,
Tomer
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 5 months