Command Line Job Unlock Option

Do you have features you'd like to see in future releases of DataStage, MetaStage, Parameter Manager, Version Control or one of the other tools represented on this forum? Post your ideas here!

Moderators: chulett, rschirm

Post Reply
sudhirmah
Participant
Posts: 17
Joined: Sat Oct 23, 2004 5:07 am

Command Line Job Unlock Option

Post by sudhirmah »

One of the most wanted option is to provide "dsjob -unlock jobname" kind of option. ofcourse with some restriction that only owner or dsadm or root can unlock the job.

thanks
SAM
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

This is probably doable. I have VB program which I can run any TCL command with. It is part of DwNav. It runs standalone though. I post with my version of DataStageBackup.bat. It does a UNLOCK READULOCK in the UV account before it exports all the projects. This is a dangerous command if you do not understand the issues. Ask Ray. I could post the VB code maybe or someone could write a BASIC program to figure out how to unlock one job.
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Nothing to stop you modifying, or creating your own, dsjob command. The API is documented (Server Job Developer's Guide and Parallel Job Developer's Guide).

I think it would need a whole lot more checking to be safe than just who is executing it. Maybe only allow locks held by defunct processes to be released without query. After all, these locks exist for a reason!

The deadlock daemon can be used to release locks held by defunct processes. If you're the administrator, you can start it in manual mode.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

Plus just killing your process is far easier. Just find the dead process and do a kill -14. Never a kill -9. EVER!

99.99% of the time, it solves the deadlock problem for me.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Make sure you always kill child processes before parent processes!

(I'm still uneasy about kill, even kill -14, and prefer UNLOCK.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

Actually, in my experience with Tru64 and AIX (unsure about other OSes), kill -14 have been very successful in telling DataStage, "Hey, clean up your stuff then close down." Just killing the "dscs" process (the parent process for DataStage client session) will unlock the jobs for me.

In the rare case it fails (usually when someone does a kill -9 and not admit to it), using the UNLOCK script will work well to clean everything up.

I know how dangerous kill can be (especially kill -9), but I have found DataStage to be robust enough to handle this behavior these days for the two OS I am using. It also comes in handy when you are without dsadm access needed, and do not want to bother your administrator.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
doesn't anybody use the cleaup resources via director and DS.TOOLS anymore?
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
sudhirmah
Participant
Posts: 17
Joined: Sat Oct 23, 2004 5:07 am

Post by sudhirmah »

After looking at the process id using cleanup resources. and after killing the pid using kill -9 <pid>, it does not work, it still says job is being accessed by another user. Once in issue the command "list_readu | grep RU | grep -v :" the process is still there
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Chances are that you haven't chosen the correct process initially. See my earlier post about child and parent processes. It's not as easy as using WMDs. You have to be very selective.
Last edited by ray.wurlod on Thu Mar 31, 2005 1:49 am, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

sudhirmah wrote:kill -9 <pid>
There's your problem RIGHT THERE!

Read my instructions very carefully.

DO NOT USE -9. DO NOT USE -9.

USE -14!

You killed DataStage using a very hard-core Operating System kill -- where everything's destroyed without mercy. This is a last resort action.

Kill -14 will tell DataStage, "Hey, please quit." DataStage have a specific internal routine that would listen to that kill request. Once it receive that kill request, it would go, "Okay, let me unlock the jobs that are locked, clean up the project VOC stuff, and a few other minor stuff, then I'll leave."

Within a few seconds, that should happens, and your locked jobs will be unlocked by magic.
Post Reply