Bug 724786 (BRMS-625) - KnowledgeAgent unsubscribes monitors, doesn't resubscribe them
Summary: KnowledgeAgent unsubscribes monitors, doesn't resubscribe them
Keywords:
Status: VERIFIED
Alias: BRMS-625
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: 5.1.0 GA
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: BRMS 5.2.0.GA
Assignee: Toni Rikkola
QA Contact: Lukáš Petrovický
URL: http://jira.jboss.org/jira/browse/BRM...
Whiteboard:
Depends On: 724785
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-11 17:33 UTC by Tihomir Surdilovic
Modified: 2022-05-31 22:28 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
A KnowledgeAgent set up to monitor a .drl file would correctly monitor the file for changes unless a change to the file introduced an error, at which point the knowledgeAgent would no longer monitor the resource for changes.
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker BRMS-625 0 Major Closed KnowledgeAgent unsubscribes monitors, doesn't resubscribe them 2013-09-26 14:40:35 UTC

Description Tihomir Surdilovic 2011-07-11 17:33:16 UTC
securitylevel_name: Public

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

Comment 1 Tihomir Surdilovic 2011-07-11 17:33:47 UTC
Link: Added: This issue depends JBRULES-2904


Comment 2 Tihomir Surdilovic 2011-07-11 17:34:20 UTC
Link: Removed: This issue depends JBRULES-2904 


Comment 3 Tihomir Surdilovic 2011-07-11 17:34:31 UTC
Link: Added: This issue is a dependency of JBRULES-2904


Comment 4 Tihomir Surdilovic 2011-07-11 17:36:11 UTC
Link: Added: This issue depends BRMS-624


Comment 5 Anne-Louise Tangring 2011-08-01 15:14:21 UTC
Candiate only, not committed.

Comment 6 Anne-Louise Tangring 2011-08-01 16:04:08 UTC
We have a One Off for this issue that should be ported to the product branch. BRMS-625

Comment 7 Toni Rikkola 2011-08-22 07:35:13 UTC
The fix for this should be in the 5.2.x branch.

Comment 8 Lukáš Petrovický 2011-08-22 07:44:43 UTC
(In reply to comment #7)
> The fix for this should be in the 5.2.x branch.

In that case, I'm sending this to be picked up by QE.

Comment 9 Tomas Schlosser 2011-08-30 10:12:20 UTC
This bug is not present in BRMS-5.3.0-ER3.

Comment 10 lcarlon 2011-08-31 03:55:51 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
https://bugzilla.redhat.com/show_bug.cgi?id=724786

A KnowledgeAgent set up to monitor a .drl file, will correctly monitor that file for changes unless a change to the file introduces an error, at which point the knowledgeAgent no longer monitors the resource for changes.

Fix and Result still required.

Comment 11 lcarlon 2011-08-31 03:57:01 UTC
Hi Toni,

I've added cause and consequence for the release notes, however I still need fix and result.

Please provide (in bullet point is fine) how this was resolved.

Thanks
Lee

Comment 12 lcarlon 2011-09-15 04:25:34 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,5 +1 @@
-https://bugzilla.redhat.com/show_bug.cgi?id=724786
+A KnowledgeAgent set up to monitor a .drl file would correctly monitor the file for changes unless a change to the file introduced an error, at which point the knowledgeAgent would no longer monitor the resource for changes. This issue has been resolved.-
-A KnowledgeAgent set up to monitor a .drl file, will correctly monitor that file for changes unless a change to the file introduces an error, at which point the knowledgeAgent no longer monitors the resource for changes.
-
-Fix and Result still required.

Comment 13 lcarlon 2011-10-05 05:22:34 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-A KnowledgeAgent set up to monitor a .drl file would correctly monitor the file for changes unless a change to the file introduced an error, at which point the knowledgeAgent would no longer monitor the resource for changes. This issue has been resolved.+A KnowledgeAgent set up to monitor a .drl file would correctly monitor the file for changes unless a change to the file introduced an error, at which point the knowledgeAgent would no longer monitor the resource for changes.


Note You need to log in before you can comment on or make changes to this bug.