Mantis - Resin
Viewing Issue Advanced Details
1033 major always 04-03-06 07:17 04-03-06 15:45
anonymous  
ferg  
normal  
closed  
fixed  
none    
none 3.0.19  
0001033: CronResource with switch to daylight time causes multiple runs
With CronResource, if there is a job scheduled to run during the 'missing' hour of a transition to daylight time, the job will be run over and over in the preceding hour until the daylight time transition.

We have a CronResource configured to run daily at 2:15 AM. When CronResource runs (or is initialized), it calculates the time of the next run. When it ran 1 Apr 2006 it calculated the time of the next run as 2:15 AM on 2 Apr 2006. Our time zone is America/New_York, so daylight time starts at 2:00 AM on 2 Apr 2006, jumping to 3:00 AM. The local time 2:15 AM 2 Apr 2006 doesn't really exist, so the run time became 1:15 AM 2 Apr 2006, and that's OK. However, when CronResource ran at 1:15 AM 2 Apr 2006, it calculated the next run time as 2:15 AM on 2 Apr 2006 again, corrected that to 1:15 AM 2 Apr 2006 again, and ran again, over and over, until the the daylight time switch at 2/3 AM.

A job that was configured to run once at 2:15 AM ran over and over from 1:15 AM until 2:00 AM.

Notes
(0000994)
anonymous   
04-03-06 07:54   
Resin versions: 3.0.18 and 3.0.14
OS: Windows XP Pro, Debian Sarge
Java version: 1.5.0_06

Snippet from web.xml:

    <resource type="com.caucho.resources.CronResource">
        <init>
            <!--<cron>*/10</cron>-->
            <cron>15 2 * * 1-7</cron>
            <work resin:type="com.example.job.DailyRunner"/>
        </init>
    </resource>
(0000998)
ferg   
04-03-06 15:45   
server/1033