Detect hanging child job through main job

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
dnsjain
Charter Member
Charter Member
Posts: 34
Joined: Thu May 08, 2003 2:12 pm

Detect hanging child job through main job

Post 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.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post 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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You could also determine its PID then issue kill 0 calls to that process, which ask "are you there?".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply