# Rclone rc vfs/refresh locking directory being refreshed

**URL:** <https://forum.rclone.org/t/rclone-rc-vfs-refresh-locking-directory-being-refreshed/9004>\
**Category:** Help and Support\
**Created:** [March 4, 2019, 3:36pm UTC](https://forum.rclone.org/t/rclone-rc-vfs-refresh-locking-directory-being-refreshed/9004 "2019-03-04T15:36:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![calisro](https://forum.rclone.org/user_avatar/forum.rclone.org/calisro/32/3130_2.png) [@calisro](https://forum.rclone.org/u/calisro)\
**Post date:** [March 4, 2019, 3:36pm UTC](https://forum.rclone.org/t/rclone-rc-vfs-refresh-locking-directory-being-refreshed/9004/1 "2019-03-04T15:36:45Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [March 4, 2019, 5:31pm UTC](https://forum.rclone.org/t/rclone-rc-vfs-refresh-locking-directory-being-refreshed/9004/2 "2019-03-04T17:31:45Z")

</div>

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/](https://beta.rclone.org/branch/v1.46.0-054-ge4f4eeb7-fix-vfs-refresh-locking-window-beta/) (uploaded in 15-30 mins)

---

<div class="post-metadata">

**Author:** ![calisro](https://forum.rclone.org/user_avatar/forum.rclone.org/calisro/32/3130_2.png) [@calisro](https://forum.rclone.org/u/calisro)\
**Post date:** [March 4, 2019, 6:26pm UTC](https://forum.rclone.org/t/rclone-rc-vfs-refresh-locking-directory-being-refreshed/9004/3 "2019-03-04T18:26:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [March 5, 2019, 2:29pm UTC](https://forum.rclone.org/t/rclone-rc-vfs-refresh-locking-directory-being-refreshed/9004/4 "2019-03-05T14:29:05Z")

</div>

> [@calisro](#):
>
> 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.

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](https://beta.rclone.org) (it will be there in 15-30 mins!)

---

<div class="post-metadata">

**Author:** ![calisro](https://forum.rclone.org/user_avatar/forum.rclone.org/calisro/32/3130_2.png) [@calisro](https://forum.rclone.org/u/calisro)\
**Post date:** [March 8, 2019, 2:29pm UTC](https://forum.rclone.org/t/rclone-rc-vfs-refresh-locking-directory-being-refreshed/9004/5 "2019-03-08T14:29:10Z")

</div>

Closed on March 8, 2019, 2:29pm UTC

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