Perl-Sensitive Sunglasses | |
PerlMonks |
File::NFSLock owner identification?by SleepyJay (Beadle) |
on Dec 05, 2013 at 22:42 UTC ( [id://1065859]=perlquestion: print w/replies, xml ) | Need Help?? |
SleepyJay has asked for the wisdom of the Perl Monks concerning the following question: I have a File::NFSLock issue that goes something like... Two (or more) servers with shared NFS space both get a request to run some process. They both try to write an NFSLock. Due to timing issues, they could BOTH think they have the lock. Obviously, only one *really* has the lock, but as far as I can tell, you can't actually know which one does. So, they both run the process, even though only one needs to. The results of the process comes out correctly, but the issue is only that both servers run the process when one would suffice. Of course, once the lock is established, future requests are locked out in the correct way until the lock is released. I was thinking that if a server could identify which one actually got the lock, at some point during the running process, it could periodically check if it were the owner of the lock. If it wasn't, it could gracefully stop the process and assume the one with the lock would finish correctly. Is there some reasonable way to do that? I guess I mean it would need to write some extra metadata into the lock that it could retrieve to identify the actual "owner". I'm sorry, I meant to say, that I have read the File::NFSLock documentation and there is no mention of being able to arbitrarily stuff data into it. I just meant if anyone had any other ideas on how to tackle this problem. Maybe I'm just posting here in the hopes someone has something enlightening and uplifting to say! :)
Back to
Seekers of Perl Wisdom
|
|