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

Re: NFS File Locking

by InfiniteSilence (Curate)
on Apr 08, 2026 at 23:43 UTC ( [id://11167510]=note: print w/replies, xml ) Need Help??


in reply to NFS File Locking

That code looks like some kind of import program where various clients put some information in a file share and it gets slurped and processed.

My immediate solution would be to identify the unique key information from the files to be processed and put them in a process log of some kind (or preferably a DB) and then run a quick check to see if the data has already been entered before proceeding with the import.

When you find an error (file already processed) you can store that in a junk folder for later evaluation and troubleshooting.

I would create a test server and a bunch of bot type clients that try to import data by the thousands to see if and when you can recreate the problem. I would exclusively unlock the file to see if that changes things (code snippet from the POD for flock):

flock($fh, LOCK_UN) or die "Cannot unlock mailbox - $!\n";

Celebrate Intellectual Diversity

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2026-04-16 01:52 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.