Rclone rc vfs/refresh locking directory being refreshed

The rc vfs/refresh seems to lock the directories being refreshed when this runs. Is there a possibility to not lock and still serve content while it runs even if the result set is just a non-cached version? Figured i’d ask here before opening an issue. There may be a technical reason this can’t be done.

I run a vfs webdav and http (non-cache backend).

Hmm… The root directory is locked for the entire refresh including fetching all the directories, but I think that is unnecessary.

Here is an experiment which fetches the new directories from the remote with the root unlocked then locks the root directory for a short time while it and the subdirectories are updated.

What do you think of that? It will be serving the original data while the refresh is going on. If a directory is being updated, I guess there is a chance that it will get out of sync.

  1. fetch remote recursive directory listing
  2. lock root directory
  3. update directory cache
  4. unlock root directory

So if while 1. is going on a directory gets updated after it has been fetched, then 3. will replace the updated directory listing with the old one. Not sure how big a problem this will be in practice…

https://beta.rclone.org/branch/v1.46.0-054-ge4f4eeb7-fix-vfs-refresh-locking-window-beta/ (uploaded in 15-30 mins)

1 Like

That is definitely better as far as locking. Since depending on the size of the remote the refresh can take a while if doing the entire recursive remote, I think the risk of that out of sync is pretty minimal. The way it is before this beta, the entire remote is locked for the duration which isn’t good. Thank you Nick. Let me know if you think you can merge this otherwise i’ll stay on this beta till then.

You are probably right, since all that was locked was the root directory not the subdirectories, so potentially that problem could be happening already.

I’ve merged the above into the latest beta (it will be there in 15-30 mins!)

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.