Job attempts to start while parent box is not running.

Document ID : KB000027035
Last Modified Date : 14/02/2018
Show Technical Document Details

Issue:

Sample job definitions:

/* ----------------- bill-box ----------------- */

insert_job: bill-box job_type: b

owner: autosys@machine1

date_conditions: 1

days_of_week: all

start_times: "10:30,10:45"

box_success: s(bill-cmd2)

 

  /* ----------------- bill-cmd1 ----------------- */

  insert_job: bill-cmd1   job_type: c

  box_name: bill-box

  command: sleep 120

  machine: machine1

  owner: autosys@machine1

  date_conditions: 1

  days_of_week: all

  start_times: "10:35,10:49"

 

If the box job, bill-box, were for some reason not running at 10:35, what would happen to the job bill-cmd1?

 

 

Environment:

Databases: all

Operating systems: all

Workload Automation AE versions: all

 

 

Resolution:

If a job's parent box is not running, a normal STARTJOB event will not cause the job to run.

Below is a sequence of events to illustrate what would occur:

  1. A STARTJOB event for bill-cmd1 is processed at 10:35.

  2. The event processor sees that the jobs parent box, bill-box, is not running and reports that it cannot start this job at this time.

  3. The next time the parent box becomes active, bill-cmd1 will start immediately regardless of the current time. The run is initiated from the previously processed STARTJOB at 10:35.

If bill-cmd1 runs to SUCCESS, it will schedule its next start time. If the SUCCESS is processed before 10:49, then the next STARTJOB will be set for 10:49. If the SUCCESS is processes after 10:51, then the next STARTJOB will schedule for 10:35 the next day.

* If bill-cmd1 schedules itself for 10:49, the event processor will process the event but will be unable to run the job. AutoSys only allows 1 run of a job per box job execution. Unfortunately, this will result in the job, bill-cmd1, running immediately the next time its parent box, bill-box, becomes active. To get out of this cycle, simply re-save the job definition for bill-cmd1. This will force AutoSys to re-evaluate the job and its starting conditions and generate a new STARTJOB event in the event table for the next available start time based on its job definition.

Below is an excerpt from the event_demon log to further illustrating this case.

-----------------------------------------------------------------------------------------
[10:30:01.2044] [4] EVENT: STARTJOB JOB: bill-box 
[10:30:01.2046] [4] <Event was Scheduled based on Job Definition.> 
[10:30:01.2641] [1] ------------------------< Date: 09/07/2007 10:30:00 >---------------- 
[10:30:02.2942] [1] EVENT: CHANGE_STATUS STATUS: RUNNING JOB: bill-box 
[10:31:01.5542] [1] ------------------------< Date: 09/07/2007 10:31:00 >---------------- 
[10:31:01.5957] [1] EVENT: STARTJOB JOB: bill-cmd2 
[10:31:01.5959] [1] <Event was Scheduled based on Job Definition.> 
[10:31:01.9255] [1] [machine1 connected for bill-cmd2] 
[10:31:02.7987] [3] EVENT: CHANGE_STATUS STATUS: STARTING JOB: bill-cmd2 
[10:31:06.0344] [3] EVENT: CHANGE_STATUS STATUS: RUNNING JOB: bill-cmd2 
[10:31:17.4950] [2] EVENT: CHANGE_STATUS STATUS: SUCCESS JOB: bill-cmd2 
[10:31:20.2218] [2] EVENT: CHANGE_STATUS STATUS: SUCCESS JOB: bill-box 
[10:32:01.6330] [1] ------------------------< Date: 09/07/2007 10:32:00 >---------------- 
[10:33:01.8678] [1] ------------------------< Date: 09/07/2007 10:33:00 >---------------- 
[10:34:01.5554] [1] ------------------------< Date: 09/07/2007 10:34:00 >---------------- 
[10:35:01.0600] [3] EVENT: STARTJOB JOB: bill-cmd1 
[10:35:01.0602] [3] <Event was Scheduled based on Job Definition.> 
[10:35:01.0603] [3] This job's box is not in the RUNNING state - cannot be started. 
[10:35:01.0604] [3] <Conditions do not allow Job to start. JOB NOT STARTED.> 
[10:35:01.0700] [1] ------------------------< Date: 09/07/2007 10:35:00 >---------------- 
...
[10:44:01.1860] [1] ------------------------< Date: 09/07/2007 10:44:00 >---------------- 
[10:45:01.3507] [4] EVENT: STARTJOB JOB: bill-box 
[10:45:01.3509] [4] <Event was Scheduled based on Job Definition.> 
[10:45:01.4708] [1] ------------------------< Date: 09/07/2007 10:45:00 >---------------- 
[10:45:02.4124] [2] EVENT: CHANGE_STATUS STATUS: RUNNING JOB: bill-box 
[10:45:03.2062] [2] [machine1 connected for bill-cmd1] 
[10:45:04.3626] [2] EVENT: CHANGE_STATUS STATUS: STARTING JOB: bill-cmd1 
[10:45:06.0307] [3] EVENT: CHANGE_STATUS STATUS: RUNNING JOB: bill-cmd1 
[10:46:01.6590] [1] ------------------------< Date: 09/07/2007 10:46:00 >---------------- 
[10:47:01.8809] [1] ------------------------< Date: 09/07/2007 10:47:00 >---------------- 
[10:47:07.0341] [4] EVENT: CHANGE_STATUS STATUS: SUCCESS JOB: bill-cmd1 
[10:49:01.8958] [4] EVENT: STARTJOB JOB: bill-cmd1 
[10:49:01.8960] [4] <Event was Scheduled based on Job Definition.> 
[10:49:01.9159] [4] Job has already Run - Cannot be Started. 
[10:49:01.9161] [4] <Conditions do not allow Job to start. JOB NOT STARTED.> 
[10:49:02.0320] [1] ------------------------< Date: 09/07/2007 10:49:01 >---------------- 
-----------------------------------------------------------------------------------------