Bug 1025296

Summary: Delay of KieScanner is more than expected
Product: [Retired] JBoss BRMS Platform 6 Reporter: Tomas David <tdavid>
Component: BREAssignee: Mario Fusco <mfusco>
Status: CLOSED CURRENTRELEASE QA Contact: Tomas David <tdavid>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.0   
Target Milestone: ER6   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:17:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tomas David 2013-10-31 12:23:56 UTC
Description of problem:
When KieScanner.start(pollingInterval) is called. Delay of KieScanner is more than 200ms (KieScanner find out new module after pollingInterval + 200ms).

Version-Release number of selected component (if applicable):
Pull request #277 submited in Drools.

How reproducible:
Drools 6.0.0-SNAPSHOT
Drools 6.0.0.ER4

Steps to Reproduce:
1. Write a test with KieScanner for specific KieContainer. Deploy artifact with module containing some rule. Start KieScanner with some pollingInterval. Check that KieSession from kiecontainer works with rule. 
2. Deploy artifact with module containing some other rule. Find out a time when kieSession works with new rule.
3. Run test.

Actual results:
Delay of KieScanner is more than 200ms.

Expected results:
Delay of KieScanner should be less than 200ms.

Additional info:

Comment 2 Mario Fusco 2013-11-22 14:16:54 UTC
I believe the test is wrong because the timer is started before deploying the new artifact into the maven repository while in my opinion it should start after that. Doing so the test succeeds as expected.

Moreover running this test made me discover a regression that has been caused by the introduction of incremental compilation. This issue didn't exist (as the incremental compilation feature) when this ticket has been opened. I reported this problem here https://bugzilla.redhat.com/show_bug.cgi?id=1033612 and already fixed it.

Comment 3 Tomas David 2013-11-25 09:41:12 UTC
So "kieScanner.start(500)" means:
After deploying the new artifact into the maven repository, kieScanner waits 500ms and then kieSession works with new artifact?

I thought that kieScanner checks if there is some new artifact every 500ms from start.

Comment 4 Mario Fusco 2013-11-27 16:45:35 UTC
No, but starting the timer before the deploy means that you're also counting the time consumed by the deployment process and this is way the final result is greater than expected.

Comment 5 Tomas David 2014-01-10 09:14:04 UTC
Thank you. I updated my tests.

Verified on BRMS 6.0.0.ER7.