Page 1 of 1

Detect hanging child job through main job

Posted: Fri Mar 11, 2005 10:29 am
by dnsjain
Is there a way to detect hanging child job from main sequence job? I have main sequence job which calls multiple jobs in a sequence. I am expecting each job to finish in X number of minutes. I want to send e-mail to support group if job does not finish in 2X minutes. I am looking for something like timeout parameter where you can define the number of minutes for the job to finish and if it does not finish then you should be able to trigger the event.

Posted: Fri Mar 11, 2005 10:39 am
by Sainath.Srinivasan
One option ....

After each job, copy / move a blank (e.g. using touch command) in a given area. Just before calling the job, activate a 'wait-for-file' for the result file to appear. If the job completes, it will. Othewise not.

Alternatively, the real solution is .....

to store the process metadata in a table and keep polling using a separate job which can compare the timings.

Posted: Fri Mar 11, 2005 10:57 am
by ArndW
Another option would be to code in a function, and use the DSAttachJob to get a handle to that job, then, in a loop, use DSGetJobInfo to see the job's status, wait a given period, and if it takes too long the call to abort the job.

Posted: Sat Mar 12, 2005 10:33 pm
by ray.wurlod
You could also determine its PID then issue kill 0 calls to that process, which ask "are you there?".