[jboss-jira] [JBoss JIRA] (DROOLS-497) KnowledgeBase's ruleBase is never unlocked when an exception is thrown by executed rules

Antonio Ruberto (JIRA) issues at jboss.org
Thu May 22 10:14:58 EDT 2014


Antonio Ruberto created DROOLS-497:
--------------------------------------

             Summary: KnowledgeBase's ruleBase is never unlocked when an exception is thrown by executed rules
                 Key: DROOLS-497
                 URL: https://issues.jboss.org/browse/DROOLS-497
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
    Affects Versions: 5.6.0.Final
            Reporter: Antonio Ruberto
            Assignee: Mark Proctor


We have a KnowledgeBase that is built application start up from which we constantly create new KnowledgeSession from.

If the execution of one of those sessions throws an exception (i.e. one of the rules in the KnowledgeBase throws an exception for some reason), any subsequent KnowledgeSessions that are created and executed get dead locked. The issue stems from the initInitialFact() method in AbstractWorkingMemory.java as seen below. An exception thrown by the underlying rule causes ruleBase.unlock() to never be reached.

{code}
    public void initInitialFact( InternalRuleBase ruleBase, MarshallerReaderContext context ) {
        ruleBase.lock();
        Object initialFact = InitialFactImpl.getInstance();

        ObjectTypeConf otc = this.defaultEntryPoint.getObjectTypeConfigurationRegistry()
                .getObjectTypeConf( this.defaultEntryPoint.entryPoint, initialFact );

        this.initialFactHandle = ruleBase.getConfiguration().getComponentFactory().getFactHandleFactoryService().newFactHandle(
                0, initialFact, 0, otc, this, this.defaultEntryPoint );

        final PropagationContext pctx = new PropagationContextImpl( 0,
                                                                    PropagationContext.ASSERTION,
                                                                    null,
                                                                    null ,
                                                                    initialFactHandle,
                                                                    0,
                                                                    0,
                                                                    defaultEntryPoint.getEntryPoint(),
                                                                    context );

        otc.getConcreteObjectTypeNode().assertObject( this.initialFactHandle, pctx, this );
        // ADDED, NOT IN THE ORIGINAL 6.x COMMIT
        pctx.evaluateActionQueue( this );
        ruleBase.unlock();
    }
{code}



--
This message was sent by Atlassian JIRA
(v6.2.3#6260)


More information about the jboss-jira mailing list