Vinay Pareek created DROOLS-638:
-----------------------------------
Summary: KnowledgeAgent incremental build stuck infinite if have two rules
with same condition in steam mode
Key: DROOLS-638
URL:
https://issues.jboss.org/browse/DROOLS-638
Project: Drools
Issue Type: Bug
Affects Versions: 5.6.0.Final
Environment: Windows 8 64bit Machine, Java jdk1.7.0_51
Reporter: Vinay Pareek
Assignee: Mark Proctor
If we have two rules on same condition in Steam mode, first time agent able to pick both
and work fine.
When we update any rule (then part), KnowledgeAgent will stuck infinite after printing
below logs.
[2014-10-24 17:59:04,066:debug] KnowledgeAgent received ChangeSet changed notification
[2014-10-24 17:59:04,066:info] KnowledgeAgent applying ChangeSet
[2014-10-24 17:59:04,067:debug] KnowledgeAgent removing mappings for
resource=[FileResource file='rule\streamRule.drl'] with unsubscribe=false
[2014-10-24 17:59:04,067:debug] KnowledgeAgent rebuilding KnowledgeBase using ChangeSet
[2014-10-24 17:59:04,076:info] KnowledgeAgent performing an incremental build of the
ChangeSet
[2014-10-24 17:59:04,193:debug] KnowledgeAgent: Diffing: [FileResource
file='rule\streamRule.drl']
Below is code snippet for KnowledgeAgent
KnowledgeAgentConfiguration kaconf = KnowledgeAgentFactory
.newKnowledgeAgentConfiguration();
kaconf.setProperty("drools.agent.scanDirectories", "true");
kaconf.setProperty("drools.agent.newInstance", "false");
KnowledgeBaseConfiguration config = KnowledgeBaseFactory
.newKnowledgeBaseConfiguration();
config.setOption(EventProcessingOption.STREAM);
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(config);
final KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(
"kagent", kbase, kaconf);
kagent.setSystemEventListener(new PrintStreamSystemEventListener());
kagent.addEventListener(new KnowledgeAgentEventListener() {
public void resourceCompilationFailed(
ResourceCompilationFailedEvent arg0) {
LOGGER.error("Unable to compile Knowledge" + arg0.toString());
throw new RuntimeException("Unable to compile Knowledge"
+ arg0.toString());
}
public void knowledgeBaseUpdated(KnowledgeBaseUpdatedEvent arg0) {
LOGGER.info("********** KBase was updated***********");
}
public void beforeResourceProcessed(
BeforeResourceProcessedEvent arg0) {
}
public void beforeChangeSetProcessed(
BeforeChangeSetProcessedEvent arg0) {
}
public void beforeChangeSetApplied(BeforeChangeSetAppliedEvent arg0) {
}
public void afterResourceProcessed(AfterResourceProcessedEvent arg0) {
}
public void afterChangeSetProcessed(
AfterChangeSetProcessedEvent arg0) {
}
public void afterChangeSetApplied(AfterChangeSetAppliedEvent arg0) {
}
});
ResourceChangeScannerConfiguration sconf = ResourceFactory
.getResourceChangeScannerService()
.newResourceChangeScannerConfiguration();
sconf.setProperty("drools.resource.scanner.interval", "2");
ResourceFactory.getResourceChangeScannerService().configure(sconf);
kagent.applyChangeSet(ResourceFactory
.newClassPathResource("changeset/changeSet.xml"));
ResourceFactory.getResourceChangeNotifierService().start();
ResourceFactory.getResourceChangeScannerService().start();
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)