n_retrys: 2 = up to 2 extra runs after a FAILURE, started right away.
Retries help with short blips (a network hiccup, a brief lock), not with outages.
For a planned outage, move start_times or add a condition on a check job.
term_run_time: 60 = AutoSys kills the job after 60 minutes; status TERMINATED.
max_run_alarm only raises an alarm; term_run_time actually stops the job.
Set term_run_time well above the longest normal run.
β¦ Definition~90s read
What is AutoSys n_retrys and term_run_time?
n_retrys and term_run_time are AutoSys job attributes. n_retrys sets how many times AutoSys reruns a job after it fails. term_run_time sets a maximum run time in minutes; when it's reached, AutoSys kills the job and it ends TERMINATED.
β
n_retrys is 'try again if it fails', with no pause in between.
Plain-English First
n_retrys is 'try again if it fails', with no pause in between. term_run_time is an egg timer: when it rings, the job is stopped no matter what.
LOAD_GL had n_retrys: 2, so the team expected it to survive the database maintenance window. All three runs failed within two minutes.
n_retrys in JIL
Set the number of reruns on the job definition. Each failure uses one; when they're gone, the job stays in FAILURE and alarms fire as usual.
retry.jilJIL
1
2
update_job: LOAD_GL
n_retrys: 2
π― Key Takeaway
Retries are immediate.
term_run_time in JIL
Value is in minutes. When the job reaches it, AutoSys kills the process and sets TERMINATED. Dependent jobs waiting on s(LOAD_GL) won't start.
LOAD_GL FAILURE, exit 1, three runs between 02:12 and 02:14.
Assumption
n_retrys would wait out the maintenance window.
Root cause
Retries start immediately. Maintenance ran 02:00 to 02:30, so all three runs hit it.
Fix
Moved start_times to 02:40 and kept n_retrys: 1 for short blips. Added term_run_time: 120 after a hang a week later.
Key lesson
Retries don't wait.
Schedule around known outages.
Use term_run_time to stop hung jobs.
Production debug guideWork through these in order4 entries
Symptom · 01
Job failed several times within minutes
→
Fix
Check the job's run history with autorep -J JOB -r -N; retries show as separate runs.
Symptom · 02
Job failed during a known outage
→
Fix
Move start_times past the outage or add a condition; don't raise n_retrys.
Symptom · 03
Job hangs for hours
→
Fix
Add term_run_time a safe margin above the normal run time.
Symptom · 04
Job ended TERMINATED unexpectedly
→
Fix
Compare the run time with term_run_time; a slow night may need a higher limit.
⚙ Quick Reference
3 commands from this guide
File
Command / Code
Purpose
retry.jil
update_job: LOAD_GL
n_retrys in JIL
kill.jil
update_job: LOAD_GL
term_run_time in JIL
history.sh
autorep -J LOAD_GL -r -5
See retries and run times
Key takeaways
1
n_retrys reruns immediately.
2
Schedule around outages.
3
term_run_time kills; max_run_alarm warns.
Common mistakes to avoid
3 patterns
×
Raising n_retrys to cover an outage
Symptom
Still fails, just more times.
Fix
Move the start time or add a condition.
×
term_run_time too close to the normal run
Symptom
Slow nights end TERMINATED.
Fix
Set it well above the longest normal run.
×
Expecting max_run_alarm to stop the job
Symptom
The job keeps running.
Fix
Use term_run_time to stop it.
INTERVIEW PREP · PRACTICE MODE
Interview Questions on This Topic
Q01SENIOR
What's the difference between max_run_alarm and term_run_time?
Q02SENIOR
Does n_retrys wait between attempts?
Q01 of 02SENIOR
What's the difference between max_run_alarm and term_run_time?
ANSWER
max_run_alarm raises an alarm when the job runs longer than N minutes; the job keeps running. term_run_time kills the job at N minutes and it ends TERMINATED.
Q02 of 02SENIOR
Does n_retrys wait between attempts?
ANSWER
No. AutoSys reruns the job as soon as it fails, so retries only help with very short problems.
01
What's the difference between max_run_alarm and term_run_time?
SENIOR
02
Does n_retrys wait between attempts?
SENIOR
FAQ · 3 QUESTIONS
Frequently Asked Questions
01
Does n_retrys add a delay between retries?
No, retries start straight away. For a delay, schedule the job later or use a condition.
Was this helpful?
02
What status does a job killed by term_run_time get?