Last run time in ScheduledJobRunner

Hi,

I was checking a case where a Service Job failed to run because of a server failure (container got killed while job was running), which first kept back the execution of a new JobRun until the expireLockTime had passed.
The next execution clears the lock, but it keeps the lastRunTime at the time the lock was created. This has the effect that the serviceJob is not run within the assigned time slot, so in our case as the job is run daily, it would be run again the next day, effectively skipping one day that goes by without any new execution attempt.
When there is a failure while executing a JobRun, the lastRunTime is set back to the value it had before, so that value should represent the last successful run time. So, following this, the behavior when expiring the lock should be to reset the lastRunTime to the time of the last successful execution, or null if there is no successful execution. Is this correct?

1 Like