Show TOC Start of Content Area

Background documentation Jobs Behavior in Irregular Circumstances  Locate the document in its SAP Library structure

This section outlines the behavior of cron jobs (jobs scheduled with cron start conditions) and recurring jobs (jobs scheduled with recurrent start conditions) and the changes that apply to jobs execution times in the cases of execution overlap, time shift, and scheduler blackout as defined below.

Execution overlap

Execution overlap denotes the following situation: JobA1 and JobA2 are successive instances of the same job definition JobA. At the time when JobA2 has to run, JobA1 is still running.

Behavior

In this case, the second job definition instance starts and runs parallel to the first one, that is, JobA2 starts to run although JA1 has not completed. This behavior applies to both cron and recurring jobs.

Time Shift

Time shift denotes the situation in which the system time of the machine where the NetWeaver Scheduler for Java is running is changed back or forward and stretches before or after the scheduled execution times of jobs.

Time Shift Forward

For example, now it is 1:35 AM, you have a job JobABC scheduled to run a quarter to the hour (at 1:45 AM, 2:45 AM, and so on), and you now change the system time to 3:00 AM.

Behavior

When time is shifted forward, the behavior of cron jobs is different from that of recurrent jobs.

      Cron jobs

With cron jobs, all the execution times that fall into the time-shift frame are skipped. The next execution times after the time-shift are as scheduled relative to the newly set time. In the example above, the execution times at 1:45 AM and 2:45 AM are skipped. The next execution time of the JobABC is at 3:45 AM.

      Recurrent jobs

With recurrent jobs, all the execution times that fall into the time-shift frame are skipped. In place of all the skipped instances of a particular job definition, a single shifted job runs at a shifted execution time which is relative to the newly set time. The shifted execution time is calculated as follows:

the moment to which the time is shifted + (the next earliest original execution time of any job waiting for execution – the time at which system time was shifted)

The shifted execution time triggers the instances of all job definitions that were skipped. The rest of the execution times after the shifted one remain as scheduled relative to the newly set time.

In the example above, provided that JobABC is the only scheduled job in the system, the execution times of JobABC at 1:45 AM and 2:45 AM are skipped. In place of the two skipped jobs, a single shifted JobABC instance runs at the shifted execution time of 3:10 AM. The shifted execution time is calculated as 3:00 AM + (1:45 AM – 1:35 AM) = 10 minutes, which makes 10 minutes past 3:00 AM, as the figure below shows.

This graphic is explained in the accompanying text

The time-to-execution is the difference between the next earliest original execution time of any job waiting for execution and the time at which system time was shifted.

If apart from JobABC, another job JobXYZ is scheduled to run in the system, for example, 20 minutes to the hour (at 1:40 AM, 2:40 AM and so on), then the shifted execution time is calculated with the next original execution time of the job that runs earliest after the moment of time shift. In this case, this is the execution time of JobXYZ (JobXYZ runs 5 minutes earlier than JobABC).

The shifted execution time is calculated as follows: 3:00 AM + (1:40 AM – 1:35 AM) = 5 minutes, which makes 5 minutes past 3:00 AM. At the shifted execution time, both JobABC and JobXYZ run.

Note

If a recurrent job has a single execution time, and it falls into the time-shift frame, the scheduled execution time of the job is skipped. When the time is changed, the job is executed at a shifted execution time, calculated as described above.

Time Shift Back

For example, now it is 3:35 AM, you have a job JobABC scheduled to run at a quarter to the hour. The job already ran at 1:45 AM, and 2:45 AM. You now change the system time to 1:00 AM.

Behavior

For both cron and recurring jobs, the next execution times are not affected. The jobs do not run again at the execution times that fall into the time changed back. The jobs run again as originally scheduled.

In the example above, the past executions at 1:45 AM, and 2:45 AM that had already taken place are not repeated although the system clock will point to 1:45 AM, and 2:45 AM again. The next execution time of JobABC is at 3:45 AM.

Scheduler Blackout

Blackout denotes the period when the NetWeaver Scheduler for Java is not available at the execution time of a job, for example, if the operating system is suspended, and the job cannot run as scheduled.

Behavior

      Cron jobs

If the Scheduler Service is stopped, the execution times of the cron jobs that fall into the blackout period are skipped. The next cron job execution time is as scheduled after the Scheduler Service is started again.

If the Scheduler Service is not available due to garbage collection or communication failure, all cron jobs but one that fall into the blackout period are skipped. A single cron job runs upon system restore.

      Recurrent jobs

If the recurrent job is scheduled to run infinitely over a regular period of time, that is, no end time and iterations are specified for the job, then the execution times that fall into the blackout period are skipped. Immediately upon service restore, a single instance is executed. The rest of the execution times remain as scheduled.

If the recurrent job is scheduled to run until a specified time (end time), and the blackout period ends after this end time, a single instance is executed when the system is restored. After this, no more instances of this job definition run.

Note

If a recurrent job has a single execution time, and this execution time falls into the blackout period, then the job runs when the system is restored.

End of Content Area