Skip to content

Commit

Permalink
Fixed: Crashed Scheduled jobs are not getting rescheduled with tempor…
Browse files Browse the repository at this point in the history
…al expression

(OFBIZ-11340)

When a OFBiz server are stopped or crashed with job on queued state,
at the start, they are restarted but without information on tempExprId and recurrenceInfoId

This causes a break for recurrence jobs to their planning

Thanks to Mohammed Rehan Khan for this issue and Scott Gray for the review.
  • Loading branch information
nmalin committed Feb 6, 2020
1 parent 30a389c commit 47e689b
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,16 @@ public synchronized void reloadCrashedJobs() {
newJob.set("parentJobId", pJobId);
newJob.set("startDateTime", null);
newJob.set("runByInstanceId", null);
//don't set a recurrent schedule on the new job, run it just one time
newJob.set("tempExprId", null);
newJob.set("recurrenceInfoId", null);

// if Queued Job is crashed then its corresponding new Job should have TempExprId and recurrenceInfoId to continue further scheduling.
if ("SERVICE_QUEUED".equals(job.getString("statusId"))) {
newJob.set("tempExprId", job.getString("tempExprId"));
newJob.set("recurrenceInfoId", job.getString("recurrenceInfoId"));
} else {
//don't set a recurrent schedule on the new job, run it just one time
newJob.set("tempExprId", null);
newJob.set("recurrenceInfoId", null);
}
delegator.createSetNextSeqId(newJob);
// set the cancel time on the old job to the same as the re-schedule time
job.set("statusId", "SERVICE_CRASHED");
Expand Down

0 comments on commit 47e689b

Please sign in to comment.