in reply to Re: Can flock occasionally fail on systems that support file locking?
in thread Can flock occasionally fail on systems that support file locking?
Yes, I have read the man pages but am wondering if in practice there are occasions when there are other reasons for flock to fail.
"...If LOCK_NB is not set, one instance will wait until the other lets go."
This is what I expect to happen and how I have designed the script to work.
Unfortunately, I'm getting reports that occasionally a submission isn't making it to the data file and I'm wondering if flock is failing in these cases, thus allowing the data file to be opened, written to and closed at the same time by more than one user.
Adding error handling around flock might confirm my suspicion -- but I also wonder if flock occasionally succeeds for a second simultaneous submission because of lock inheriting or something even more mind boggling.
Richard
|
|---|