[jboss-jira] [JBoss JIRA] Resolved: (JBRULES-2904) KnowledgeAgent unsubscribes monitors, doesn't resubscribe them

Esteban Aliverti (JIRA) jira-events at lists.jboss.org
Wed Feb 16 15:51:13 EST 2011


     [ https://issues.jboss.org/browse/JBRULES-2904?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Esteban Aliverti resolved JBRULES-2904.
---------------------------------------

    Fix Version/s: 5.2.0.M2
       Resolution: Done


I think I fixed the problem: 
- Kagent is no longer unsubscribed from a resource when it is modified.
- If the compilation of a resource fails, all the knowledge definitions defined in it are removed from kbase (when working in incremental processing mode)

These are the changes and tests: https://github.com/droolsjbpm/droolsjbpm/compare/e65416a...1c2d046

Please try it and let me know the results.

> KnowledgeAgent unsubscribes monitors, doesn't resubscribe them
> --------------------------------------------------------------
>
>                 Key: JBRULES-2904
>                 URL: https://issues.jboss.org/browse/JBRULES-2904
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-core
>    Affects Versions: 5.1.1.FINAL
>            Reporter: Laird Nelson
>            Assignee: Esteban Aliverti
>             Fix For: 5.2.0.M2
>
>
> A KnowledgeAgent set up to monitor a .drl file, and set to perform incremental builds, will correctly monitor that file for changes.
> When a change to that file, however, results in a DRL syntax exception (or any other KnowledgeBuilder errors), the KnowledgeAgent no longer monitors the resource for changes.
> This means that a typo in the file effectively stops the KnowledgeAgent from ever seeing that file again.  Consequently, an error in the DRL file requires a restart to whatever server is using the KnowledgeAgent.
> Esteban and I have found that the error is related to lines 337 and following of KnowledgeAgentImpl.java.  Here is a snippet from one of his emails to me:
> "The problem seems to be related to the lines you mentioned. When a resource is modified,  all its knowledgeDefinition->resource are cleared and reconstructed later. I don't see any reason to unsubscribe the listener though. So the call to  Set<KnowledgeDefinition> definitions = this.removeResourceMapping(resource, true); should be Set<KnowledgeDefinition> definitions = this.removeResourceMapping(resource, false); 
> "That means: remove all the mappings but don't unsubscribe me (the kagent) as a listener."
> Further background can be found at http://drools-java-rules-engine.46999.n3.nabble.com/Drools-5-1-What-happens-when-an-incremental-KA-rebuild-fails-td2258083.html

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list