Issue with Term_Run_Time Not Working

Document ID : KB000074516
Last Modified Date : 22/03/2018
Show Technical Document Details
Issue:
We have a job that did not terminate after 3 hours, as defined in its job definition: 

insert_job: AUTOSYS_BATCH_CLEANUP_JOB job_type: cmd 
description: Clean Up Batch JOb on win-1136sp6
machine: WA_AGENT
resources: (Resource_A,QUANTITY=1) AND (Resource_B,QUANTITY=1) 
owner: runuser@win-1136sp6
application: ACE 
max_run_alarm: 0 
alarm_if_fail: y 
avg_runtime: 1449 
date_conditions: y 
days_of_week: su,mo,tu,we,th,fr,sa 
start_times: "04:30" 
term_run_time: 180 
send_notification: n 
std_out_file: "C:\Logs\%AUTO_JOB_NAME%.%AUTORUN%.out" 
std_err_file: "C:\Logs\%AUTO_JOB_NAME%.%AUTORUN%.err" 
command: "C:\Scripts\Batch\CleanFiles.bat" 
Environment:
CA Workload Automation AE r11.3.6+
Cause:
In the event demon log, we can see the following error after the failed KILLJOB event: 
------------------------------------------------- 
[02/25/2018 08:01:00] CAUAJM_I_40245 EVENT: CHK_TERM_RUNTIME JOB: AUTOSYS_BATCH_CLEANUP_JOB 
[02/25/2018 08:01:04] CAUAJM_I_10082 [WA_AGENT connected for KILLJOB AUTOSYS_BATCH_CLEANUP_JOB 39162.122987160.1] 
[02/25/2018 08:01:04] CAUAJM_I_40245 EVENT: ALARM ALARM: KILLJOBFAIL JOB: AUTOSYS_BATCH_CLEANUP_JOB MACHINE: WA_AGENT 
[02/25/2018 08:01:04] <Process does not exist> 
------------------------------------------------- 
Resolution:
The reason the KILLJOB event was unsuccessful was because the job's process ID was no longer available. Between the time the job started and the chk_term_runtime event , the job finished processing. The agent was not able to send a completion status back to the scheduler in order to update the job status from RUNNING to SUCCESS. Since the job remained in the RUNNING status for more than 3 hours, a KILLJOB event was attempted. The KILLJOB event failed to execute because it was not able to terminate a non-existing process ID.