A new and very robust method for doing file locking over NFS?

Douglas Alan nessus at mit.edu
Fri Apr 18 19:22:34 EDT 2003


Jeff Epler <jepler at unpythonic.net> writes:

> If the actions between the dashed lines all took place within the same
> wall second, client 1 may read its own cached data instead of the data
> written by client 2.  Our eventual solution was a kernel patch which let
> us evict any cached data for a particular file from memory, and we did
> it every time we performed a locking operation.  You can bet that
> performance suffered, but at least it was correct.

Hmmm, why not just fetch the time in between locking and unlocking and
if a second has not passed, sleep for the difference?  I suppose this
wouldn't work if you routinely need to lock a file for writing at a
rate of more than once a second, but there probably aren't that many
applications that write to files over NFS that need to be able to to
do that.

Thanks for the info -- it is very helpful.

|>oug




More information about the Python-list mailing list