Operating System - OpenVMS
1752591 Members
3020 Online
108788 Solutions
New Discussion юеВ

How do I know what is locking a file?

 
SOLVED
Go to solution
Ana M. Garc├нa Olivencia
Regular Advisor

How do I know what is locking a file?

Hi all.
I am receiving the classical error message:
%COPY-E-OPENIN, error opening
disk:[dir]file.log;1 as input
-RMS-E-FLK, file currently locked by another user

The problem is that I have no way to see which process is locking it.

If I execute:
$pipe sh dev/files|sear sys$pipe file

there is no output.

If I enter ANALYZE/SYSTEM and execute:
SDA>show proc/channel all
to an output file, the file doesn't appear.

The system is a two nodes cluster with OpenVMS v8.3.

Is there any other tool to chase the 'ghost' channel?.

Thank you very much in advance.

Regards.

Ana
13 REPLIES 13
Robert Gezelter
Honored Contributor
Solution

Re: How do I know what is locking a file?

Ana,

Have you checked the other node in the cluster?

- Bob Gezelter, http://www.rlgsc.com
Ian Miller.
Honored Contributor

Re: How do I know what is locking a file?

Try SHOW DEV/FILE on the other node

This is how I usually do it

MCR SYSMAN SET ENV/CLUSTER
SYSMAN> PIPE SHOW DEVICE/FILES/NOSYS diskname | SEAR SYS$INPUT: filename
____________________
Purely Personal Opinion
Ana M. Garc├нa Olivencia
Regular Advisor

Re: How do I know what is locking a file?

Robert, Ian.

Thanks for your answers.
Well, I executed the analyze command at the other node but not the 'pipe' command. .

The logs locked are not the original ones. The process is:
.....
original log files copied to [...temporal]*.*.*
(in this case, if the original files are locked, the files are not copied and procedure ends)

.... (some processing not involving these files)

rename [...temporal]*.*.* to [..www]*.*.*
(the rename is ok but, when the procedure is going to copy the [...www]*.*.* to a file, we get the "file currently locked by ...." message.

I think , correct me if I am in a mistake, that, in this case, the other node is not locking the files copied and renamed, because these files has only been used by the procedure.

Anyway, I think you are right that it has something to do with the cluster because this procedure has been working for a long time and, since the moment we add a second node to the cluster and started the web server, the problem is happening some times. Or perhaps it's a chance, I don't know.

I'll execute what you have said the next time I get the error and I'll let you know.

Thanks again.

Ana
labadie_1
Honored Contributor

Re: How do I know what is locking a file?

Hola Ana

Can you post, on both nodes
$ define show$debug yes
$ sh dev disk

and
$ def show$debug_lckbuf 1
$ sh dev disk

May be you have some dangling locks ?

Hoff
Honored Contributor

Re: How do I know what is locking a file?

Ghost channels? Before I go looking for the crew of the proverbial Flying Dutchman, I might look for real conflicts, albeit transient.

Is it possible that this case is simply a transient conflict; that there are logs or other files or even directory operations involved within these directories, and that by the time you get around to looking, the lock on the log file has been cleared?

I've also seen cases where the batch job log is in the same directory area as the particular batch job operation, and the batch log file itself trips file lock errors.
Ana M. Garc├нa Olivencia
Regular Advisor

Re: How do I know what is locking a file?

Labadie.
Thanks for the commands. I'll test them. Since the moment I wrote this post, the problem has not arisen.

Hoff.
I think you are right because it's something transient.

I haven't told you that the job is a network job and that the copy and rename operations are done by DECnet. This could be the problem if we had a cluster alias defined but, afaik we don't have either defined (at least, I can't see the cluster alias name with NCP>show executor char). Am I right?. Moreover, the second node has no proxy database defined.

As soon as the problem arises again, I'll make a deep research in both nodes with the commands you all have told me, and I'll let you know.

Thanks again

Ana
Ana M. Garc├нa Olivencia
Regular Advisor

Re: How do I know what is locking a file?

Hi all.
The problem has arosen and, in effect, the file is accessed by the other node. It seems that, at the beginning, I didn't do the
suitable tests at the other node.

Now it's my turn to see how to find the reason for it and solve the problem.

Thanks all for your help.

Ana
Ana M. Garc├нa Olivencia
Regular Advisor

Re: How do I know what is locking a file?

See above.
labadie_1
Honored Contributor

Re: How do I know what is locking a file?

Ana

To help you, you can try to find the log file opened by any process on a node with a command file (b.com in the following example)

$ ty b.com

$ pipe (wr sys$output "sh proc/id=''pid'/chan") | ana/sys | sea sys$pipe .log

then, if you define a symbol pid

$ pid:==202030F7

$ @b

0050 7FF7E080 81178340 DSA2:[BPFWAR.APP.LOG]BPFWAR_ECHA.LOG;56

$ pid:==2020022E

$ @b

0090 7FF7E100 811186C0 DSA0:[SYS0.SYSEXE]RDMMON.LOG;86

This is not bullet-proof, but it may help