Search code examples
autosys

Autosys - How to restart job from the middle of Box job


There are 5 jobs inside a Main Box job like this

MainBox
Job1 -> Job2 -> Job3 -> Job4 -> Job5

job2 is dependent on Job1, Job3 is dependent on Job2 and so on.

The dependency is implemented with condition attribute. For instance, Job2 has condtion: success(Job1).

On starting the MainBox, jobs will run in sequence. Suppose Job3 got failed. Now, how to re-start jobs inside MainBox from the failed Job3?

If I manually force start Job3 then it runs but the dependent Job4 does not get started after the success of Job3.


Solution

  • Actually in the setup you have mentioned, if any of the job fails, the Box will fail and downstream jobs will go to inactive state if condition is "box_terminator: y" set for the jobs. In this case you will have to manually complete the downstream by force starting each as conditions will not work as the Box itself is failed.

    In order to achieve what you need to do a little tweak in jobs, make "box_terminator: n". Then the on any job's failure, the Box will stay in running state and the downstream jobs will stay in activated state waiting for failed job to be success. You can the either mark the failed job as success to skip its run or force start to completion, since the box is still in running state, the dependencies will work for each jobs within it.

    But be sure to include "trem_runtime: value_in_minutes " for the Box, so that box fails after some time if failed job is unattended, else box will run indefinitely.

    I think this should do.