RUNNING never fails, so a hung job raises nothing by default.
max_run_alarm: 90 = MAXRUNALARM after 90 minutes; the job keeps running.
term_run_time: 240 = AutoSys kills the job after 240 minutes; status TERMINATED.
min_run_alarm: 10 = MINRUNALARM if the job completes in under 10 minutes.
Base the limits on run history: alarm at about 2x the usual run, kill well past it.
Only use term_run_time on jobs that are safe to rerun.
Route the alarms to email, chat or tickets; an alarm nobody sees doesn't help.
โฆ Definition~90s read
What is AutoSys max_run_alarm and term_run_time?
max_run_alarm, min_run_alarm and term_run_time are AutoSys job attributes measured in minutes. max_run_alarm raises a MAXRUNALARM when a job runs longer than the limit, but lets it keep running. min_run_alarm raises a MINRUNALARM when a job completes faster than the limit. term_run_time terminates the job when it runs longer than the limit, so it ends in TERMINATED.
โ
A job that hangs isn't broken in AutoSys's eyes, it's just busy.
Plain-English First
A job that hangs isn't broken in AutoSys's eyes, it's just busy. max_run_alarm is a kitchen timer that rings but leaves the oven on. term_run_time turns the oven off. min_run_alarm rings if dinner was 'ready' suspiciously fast.
EOD_POSTING normally runs for 40 minutes. One night it hung on a database lock and was still RUNNING at 07:00, when the morning reports missed their SLA. Nothing alerted, because nothing failed. Three attributes fix that.
Why a Hung Job Raises Nothing
AutoSys alarms on failures and terminations. A job blocked on a lock is still RUNNING, so it never matches an alarm condition unless you give it a time limit.
find.shBASH
1
2
autorep -J ALL -s | grep ' RU '
# EOD_POSTING 11/1401:00RU <- six hours old
๐ฏ Key Takeaway
RUNNING is never an alarm by itself.
max_run_alarm: Warn, Don't Kill
Set in minutes. When the job runs past it, AutoSys raises MAXRUNALARM. The job keeps running.
alarm.jilJIL
1
2
update_job: EOD_POSTING
max_run_alarm: 90
๐ฏ Key Takeaway
Alert at about 2x the usual run.
term_run_time: Kill a Runaway
Set in minutes. Past it, AutoSys terminates the job and it ends in TERMINATED, so your failure handling and dependencies react.
kill.jilJIL
1
2
update_job: EOD_POSTING
term_run_time: 240
โ Partial work
A killed job may have written half its output. Make sure a rerun is safe before you set term_run_time.
๐ฏ Key Takeaway
Kill only jobs that are safe to rerun.
min_run_alarm: Too Fast Is Suspicious
A 40-minute job that succeeds in 2 minutes usually processed nothing: an empty input file or a skipped step.
min.jilJIL
1
2
update_job: EOD_POSTING
min_run_alarm: 10
๐ฏ Key Takeaway
MINRUNALARM catches empty runs.
Pick the Numbers
Use the job's run history (WCC, or autorep with -r for past runs). Set max_run_alarm at about twice the usual run and term_run_time well past that.