tiled icon indicating copy to clipboard operation
tiled copied to clipboard

Do not attempt file-based locking on NFS

Open danielballan opened this issue 4 years ago • 2 comments

The Cache.on_disk uses file-based locking (same as dask does). This does not work on NFS.

  1. Use this solution to detect whether we are on NFS and raise an error.
  2. Mention this limitation in the docs.

danielballan avatar Jun 07 '21 21:06 danielballan

stat -f -L -c %T localdir

danielballan avatar Aug 12 '22 11:08 danielballan

When we begin apply a cache by default, we can prefer XDG_USER_CACHE but fall back to a temporary directory if the home filesystem is detected to be NFS or some unrecognized filesystem. (Another alternative is to fall back to memory, but SQLite will keep a page cache in memory anyway, and using a temporary database gives it a way to respond to memory pressure.)

I briefly looked at ways to sync it back into the XDG_USER_CACHE directory periodically or at process exit (SQLite backup or VACUUM) but all these could get tripped up if multiple processes were running or exiting at once. Better to just forfeit the cache.

danielballan avatar Jul 04 '23 12:07 danielballan