[jboss-jira] [JBoss JIRA] Updated: (JBRULES-3078) fail to remove timerjob on removing timerrule
winton xu (JIRA)
jira-events at lists.jboss.org
Mon Jun 13 02:15:23 EDT 2011
[ https://issues.jboss.org/browse/JBRULES-3078?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
winton xu updated JBRULES-3078:
-------------------------------
Attachment: TimerRule.drl.txt
TimerRuleTest.java.txt
> fail to remove timerjob on removing timerrule
> ---------------------------------------------
>
> Key: JBRULES-3078
> URL: https://issues.jboss.org/browse/JBRULES-3078
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: drools-core
> Affects Versions: 5.2.0.CR1
> Reporter: winton xu
> Assignee: Mark Proctor
> Priority: Critical
> Attachments: TimerRule.drl.txt, TimerRuleTest.java.txt
>
>
> we can reproduce it by the following steps;
> 1.create a TimerRule.(check attachement TimerRule.drl.txt)
> 2.fire the timerRule, then remove the timerRule. ( check attachement TimerRuleTest.java.txt)
> Actual: the timerJob still run over and over again after removing timerRule.
> Expected: the timerJob will be remove while removing timerRule;
> more detail:
> when we remove TimerRule, the status of interface 'acivation' will be checked,
> if 'activation' is activated, the timerJob will be removed.
> else the timerJob will be still run over and over again;
> {noformat}
> if ( activation.isActivated() ) {
> activation.remove();
> ....
> }
> RuleTerminalNode.java line 530
> {noformat}
> the method 'activation.setActivate(boolean)' is called twice while timerjob running.
> 1.setActivate(false) (Scheduler.java:71)
> 2.fire timer rule
> 3.setActivate(true) (Scheduler.java:77)
> if the method kbase.removeRule(String,String) is called between 1 and 3.
> we fail to remove timerjob because 'acivation' is inactivated.
> BTW, there is a bug on method JDKTimerService.removeJob(JobHandle jobHandle).
> if timerJob is running, we will fail to remove timerJob.
> because timerjob is not exist on scheduler.
> but a new timerjob will be add to scheduler on the end of running timerJob.(JDKTimerService.java line 79)
> maybe we can inform that there is no need to add new timerjob to scheduler, when the result of the method 'this.scheduler.remove(..)' is 'false'.
--
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