History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QUARTZ-678
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Henri Yandell
Reporter: Wessel van Norel
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Quartz Scheduler

CronTrigger may return a firing time not included in the calender (based on QUARTZ-557)

Created: 14/Jul/08 08:38 AM   Updated: 02/Aug/08 09:25 PM
Component/s: Triggers
Affects Version/s: 1.6
Fix Version/s: 1.6.1

File Attachments: 1. Text File CrontTrigger-Quartz-678.patch (2 kb)
2. Text File CrontTrigger-QUARTZ-678.v2.patch (2 kb)

Issue Links:
Related
 
This issue is related to:
QUARTZ-557 Cron/Simple Trigger may return a firi... Major Closed

Flags: Important


 Description  « Hide
The code for the "updateWithNewCalendar" method in "CronTrigger" and "SimpleTrigger" in the 1.06 release doesn't look right. It may set the "nextFireTime" field to something that is NOT included in the passed calendar. The code reads as follows: (I have no idea why anyone may use a loop that clearly iterates only once..) If the
misfire condition is true, the value assigned to the "nextFireTime" won't be checked by the calendar.

    {
        nextFireTime = getFireTimeAfter(previousFireTime);
        
        Date now = new Date();
        do {
            while (nextFireTime != null && calendar != null
                    && !calendar.isTimeIncluded(nextFireTime.getTime())) {
                nextFireTime = getFireTimeAfter(nextFireTime);
            }
            
            if(nextFireTime != null && nextFireTime.before(now)) {
                long diff = now.getTime() - nextFireTime.getTime();
                if(diff >= misfireThreshold) {
                    nextFireTime = getFireTimeAfter(nextFireTime);
                    continue;
                }
            }
        }while(false);
    }


 All   Comments   Change History      Sort Order:
Wessel van Norel - [14/Jul/08 09:00 AM ]
Patch based on the change to SimpleTrigger for QUARTZ-557

Wessel van Norel - [14/Jul/08 09:24 AM ]
Ignore the first patch. I was too quick with uploading it. v2 is correct (although I had to add the "give up year" to this trigger as well. But I guess 2299 is save to use...

James House - [02/Aug/08 09:25 PM ]
applied patch. Thanks!