Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: NFS File Locking

by hippo (Archbishop)
on Apr 09, 2026 at 13:32 UTC ( [id://11167513]=note: print w/replies, xml ) Need Help??


in reply to NFS File Locking

I am wondering if this is a known problem and if there is a preferred way to work around this.

The workaround (in the scenario where you are unlinking a worked-upon file) would be to lock a file other than the one on which you are operating. All your workers should be attempting to lock $lock_file_name and only once the lock is achieved should they even begin to look at $file_name and operate on it. This allows operations such as creation and deletion of the object file which could otherwise be troublesome.

All that said, it does still sound a bit like an XY Problem perhaps along the lines of that to which brother InfiniteSilence alludes.


🦛

Replies are listed 'Best First'.
Re^2: NFS File Locking
by Fletch (Bishop) on Apr 09, 2026 at 14:03 UTC

    Prossibly completely irrelevant, but: I want to say that folk wisdom was to use a directory as lock when attempting to do any sort of locking over NFS as operations on those were a bit more robust pre nfsv4. I haven't tried to do locking on anything on NFS in anger in aeons so YMMV, contents may have settled during shipping, yadda yadda.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11167513]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2026-05-12 06:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.