[ 
https://issues.apache.org/jira/browse/OFBIZ-12864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17781004#comment-17781004
 ] 

Deepak Dixit commented on OFBIZ-12864:
--------------------------------------

To address the issue, adding a new field named JobSandbox.runTimeEpoch. This 
field would store the UTC epoch milliseconds of the runtime date. 
When scheduling or rescheduling recurring jobs, the system would use the UTC 
epoch stored in JobSandbox.runTimeEpoch for recurring job comparison.

This solution ensures that the system uses a consistent, UTC-based time for 
scheduling and rescheduling recurring jobs, even when DST changes affect the 
local time.

To implement this solution, we need to do following things:


- Modify the PersistedServiceJob.createRecurrence method to calculate and store 
the UTC epoch milliseconds in the JobSandbox.runTimeEpoch field.
- Update the code responsible for polling and rescheduling jobs to use the 
JobSandbox.runTimeEpoch field when it is set. If the field is not set, It would 
fall back to getting the runtime date to filter the jobs.

By using this approach, the system should be able to handle recurring job 
scheduling more reliably, especially when DST changes are involved, as it 
ensures that all time comparisons are made in a consistent UTC format.
 

> Issue with OFBiz Job Scheduler and Daylight Saving Time
> -------------------------------------------------------
>
>                 Key: OFBIZ-12864
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-12864
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework/service
>    Affects Versions: Upcoming Branch, 18.12.08
>            Reporter: Deepak Dixit
>            Assignee: Deepak Dixit
>            Priority: Major
>
> The issue occurs when DST changes, and OFBiz fails to schedule recurring jobs 
> properly. 
>  
> This is due to a condition in the PersistedServiceJob.createRecurrence method 
> where it compares the next scheduled time (next) with the start time 
> (startTime) for the job.
>  
>  
> {{}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to