# Testing for new vfs cache mode features

**URL:** <https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905>\
**Category:** Dev Discussions\
**Created:** [June 4, 2020, 9:54pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905 "2020-06-04T21:54:37Z")\
**Posts on this page:** 20\
**Page:** 10

<div class="post-metadata">

**Author:** ![Animosity022](https://forum.rclone.org/user_avatar/forum.rclone.org/animosity022/32/451_2.png) [@Animosity022](https://forum.rclone.org/u/Animosity022)\
**Post date:** [June 28, 2020, 6:35pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/181 "2020-06-28T18:35:17Z")

</div>

> [@Justin\_Wedepohl](#):
>
> any creative suggestions

I don't think there is much magic other than running a lower dir cache time and let it expire. You could script rc command but that feels like overkill.

---

<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:** [June 28, 2020, 9:48pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/182 "2020-06-28T21:48:23Z")

</div>

> [@guizadas](#):
>
> Updated to the latest and it is now working as expected. No issues to report so far!

Good news! I'll merge the current branch into master tomorrow 🙂

---

<div class="post-metadata">

**Author:** ![random404](https://forum.rclone.org/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@random404](https://forum.rclone.org/u/random404)\
**Post date:** [June 30, 2020, 8:14am UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/183 "2020-06-30T08:14:04Z")

</div>

I finally want to test this but I'm a bit lost. What is the link to the real latest beta in this branch?

It might be a good idea to keep this link updated in the first post.

```auto
  --user-agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36' \
  --config=/home/user/.config/rclone/rclone.conf \
  --allow-other \
  --fast-list \
  --vfs-read-chunk-size=10M \
  --vfs-read-chunk-size-limit=0 \
  --buffer-size=0 \
  --poll-interval=1m \
  --no-modtime \
  --drive-pacer-min-sleep=10ms \
  --dir-cache-time=24h \
  --timeout=10m \
  --umask=002 \
  --union-search-policy=eprand \
  --log-level INFO \
  --log-file /opt/rclone.log \
  --async-read=false \

```

This is my current settings. I have read that it's not possible to use `buffer-size=0` is this still true?

I want the settings that gives me the minimum bandwidth per open file as possible. So I can open as many files as possible

---

<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:** [June 30, 2020, 12:13pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/184 "2020-06-30T12:13:12Z")

</div>

I've merged the new VFS to master now which means it will be in [the latest beta](https://beta.rclone.org) in 15-30 mins and released in v1.53 😄 - specifically from [https://beta.rclone.org/v1.52.2-186-g96c2fdb4-beta/](https://beta.rclone.org/v1.52.2-186-g96c2fdb4-beta/) onwards.

It has been quite a journey - the first commit was made on 12th Feb 2020 and I merged all 40 commits on 30th June.

```
 49 files changed, 7552 insertions(+), 2287 deletions(-)

```

I've worked very hard to make it super reliable. There will undoubtedly be more features to come to address the issues that have come up!

Thank you to you all for testing and feedback!

-- Nick Craig-Wood - rclone maintainer - please consider [supporting the project](https://rclone.org/donate/) - thanks!

---

<div class="post-metadata">

**Author:** ![Dimtar](https://forum.rclone.org/user_avatar/forum.rclone.org/dimtar/32/75_2.png) [@Dimtar](https://forum.rclone.org/u/Dimtar)\
**Post date:** [June 30, 2020, 12:30pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/185 "2020-06-30T12:30:01Z")

</div>

I tried the very early version and found that files wouldn't upload in Windows, folders would create but nothing would ever go up. I gave the very latest version (before the master beta) on Windows a go and I couldn't get it to break, worked flawlessly.

Rclone is an excellent tool and this makes it even better which I didn't think possible.Thank you so much for your work and this new feature.

---

<div class="post-metadata">

**Author:** ![darthShadow](https://forum.rclone.org/user_avatar/forum.rclone.org/darthshadow/32/1322_2.png) [@darthShadow](https://forum.rclone.org/u/darthShadow)\
**Post date:** [June 30, 2020, 4:14pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/186 "2020-06-30T16:14:13Z")

</div>

Is there any way to handle renames of files while they are being uploaded? It seems to be renamed fine in cache but the upload to the remote fails with these errors:

```auto
2020/06/30 18:07:47 ERROR : test.bin.partial~: Failed to calculate src hash: hash: failed to open: open /home/darthshadow/rclone/vfs/TD/vfs/PersonalTD/Media/test.bin.partial~:
no such file or directory
2020/06/30 18:07:47 ERROR : test.bin.partial~: corrupted on transfer: MD5 hash differ "" vs "2dd26c4d4799ebd29fa31e48d49e8e53"
2020/06/30 18:07:47 INFO : test.bin.partial~: Removing failed copy
2020/06/30 18:07:48 ERROR : test.bin.partial~: vfs cache: failed to upload try #1, will retry in 1m0s: vfs cache: failed to transfer file from cache to remote: corrupted on transfer: MD5 hash differ "" vs "2dd26c4d4799ebd29fa31e48d49e8e53"

```

In the above scenario, these were the steps performed:

- Create a `test.bin.partial~`
- Observe that it starts getting uploaded.
- Rename to `test.bin`

It does succeed on the second try, but that results in it being uploaded twice. Any chance the rename could be applied post-upload and handled for the post-upload checksum too?

* * *

Also, would it be possible to convert the INFO logs for cache expiry of the metadata file to DEBUG instead? I think a single log for the cache expiry of the actual file should probably be sufficient for most users.

---

<div class="post-metadata">

**Author:** ![dotsam](https://forum.rclone.org/user_avatar/forum.rclone.org/dotsam/32/1375_2.png) [@dotsam](https://forum.rclone.org/u/dotsam)\
**Post date:** [June 30, 2020, 7:43pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/187 "2020-06-30T19:43:09Z")

</div>

> [@ncw](#):
>
> I've worked very hard to make it super reliable. There will undoubtedly be more features to come to address the issues that have come up!
> 
> Thank you to you all for testing and feedback!

Thanks Nick for your work on this! It's a huge improvement over the old cache backend in every possible way!

Just to throw a few feature requests in here before this thread is wrapped up: I'd love to see RC endpoints for the VFS cache. Specifically, one that lists the contents of the cache (along with their expiry time) along with the total size and configured max size and expiry time. The other one would be an endpoint to manually remove items from the cache.

---

<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:** [July 1, 2020, 5:11pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/188 "2020-07-01T17:11:17Z")

</div>

> [@dotsam](#):
>
> Thanks Nick for your work on this! It's a huge improvement over the old cache backend in every possible way!

Thank you 😃

> [@dotsam](#):
>
> Just to throw a few feature requests in here before this thread is wrapped up: I'd love to see RC endpoints for the VFS cache. Specifically, one that lists the contents of the cache (along with their expiry time) along with the total size and configured max size and expiry time. The other one would be an endpoint to manually remove items from the cache.

Both great ideas - I'll add them to the list when I do the vfs cache API which should be soon!

---

<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:** [July 1, 2020, 5:29pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/189 "2020-07-01T17:29:16Z")

</div>

> [@darthShadow](#):
>
> Is there any way to handle renames of files while they are being uploaded? It seems to be renamed fine in cache but the upload to the remote fails with these errors:

I managed to replicate that no trouble.

Probably my preferred approach to this would be to cancel the upload and restart it under the new name.

What do you think of that approach? This is likely to happen at the start of an upload I think.

The other approach requires pending renames which rclone does do for non vfs cached files. I took it out for the vfs full/writes cache as it is has rather a lot of edge cases!

The idea of the --vfs-write-back delay (default 5s) is that it gives apps time to close the file then rename it before rclone starts uploading it. You could also try increasing that time. Which app are you having the problem with out of interest?

> [@darthShadow](#):
>
> Also, would it be possible to convert the INFO logs for cache expiry of the metadata file to DEBUG instead? I think a single log for the cache expiry of the actual file should probably be sufficient for most users.

I think you mean these ones

```auto
vfscache/item.go: fs.Infof(item.name, "vfs cache: removed cache file as %s", reason)
vfscache/item.go: fs.Infof(item.name, "vfs cache: removed metadata from cache as %s", reason)

```

I think they could both be debugs probably - what do you think?

---

<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:** [July 1, 2020, 5:31pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/190 "2020-07-01T17:31:57Z")

</div>

> [@random404](#):
>
> I finally want to test this but I'm a bit lost. What is the link to the real latest beta in this branch?

It is now in [the latest beta](https://beta.rclone.org) 🙂

> [@random404](#):
>
> This is my current settings. I have read that it's not possible to use `buffer-size=0` is this still true?

That will work fine now.

> [@random404](#):
>
> I want the settings that gives me the minimum bandwidth per open file as possible. So I can open as many files as possible

> [@random404](#):
>
> ```auto
> --vfs-read-chunk-size=10M \
> --vfs-read-chunk-size-limit=0 \
> 
> ```

These don't affect memory use at all - they are the chunk sizes rclone requests from the upstream so you can make them bigger or use the defaults.

You could add `--use-mmap` which makes rclone much better at returning buffers to the OS, though with `--buffer-size 0` it won't have any effect...

---

<div class="post-metadata">

**Author:** ![darthShadow](https://forum.rclone.org/user_avatar/forum.rclone.org/darthshadow/32/1322_2.png) [@darthShadow](https://forum.rclone.org/u/darthShadow)\
**Post date:** [July 1, 2020, 7:36pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/191 "2020-07-01T19:36:01Z")

</div>

> [@ncw](#):
>
> What do you think of that approach? This is likely to happen at the start of an upload I think.

I would still prefer the post-upload rename if you can make it work because the rename sometimes happens a couple of minutes into the upload which is wasted bandwidth. However, if there are edge cases with that which are difficult to resolve, then this approach is fine with me too, as long as it's not uploaded completely twice.

> [@ncw](#):
>
> You could also try increasing that time.

I would have thought so and did increase it to 30s but that didn't solve it. It did work with 2m eventually and even that seems random in the amount of time after the write that the rename occurs.

> [@ncw](#):
>
> Which app are you having the problem with, out of interest?

This is with Radarr which writes partial files and then renames it to the non-partial variant after the write is done.

> [@ncw](#):
>
> I think they could both be debugs probably - what do you think?

The cache expiry log was info level earlier too, so I am not sure whether you want to make it debug now. It may be useful for someone. My only interest is to reduce the number of logs unless there is a case where the actual file and its metadata can expire at different times.

* * *

Another issue on another system that I have observed is when the modification time of the file is updated after a rename which results in the following errors:

```auto
2020/07/01 19:32:05 INFO : storage/blobs/pmw6tvzmf2jv6giyybmmvl4o2ahqlaldsaeha4yx74n5aaaaaaaa/hk/n5lbitsg2jt3egg3m2otcmt2qrmugaoxcodn7l3l3tordogpmq.sj1: Renamed in cache to "storage/trash/pmw6tvzmf2jv6giyybmmvl4o2ahqlaldsaeha4yx74n5aaaaaaaa/hk/n5lbitsg2jt3egg3m2otcmt2qrmugaoxcodn7l3l3tordogpmq.sj1"
2020/07/01 19:32:06 ERROR : storage/blobs/pmw6tvzmf2jv6giyybmmvl4o2ahqlaldsaeha4yx74n5aaaaaaaa/hk/qich57lbblrcv75tligqhvnwrhkdvxdvb4q35uzrbmppx5n47q.sj1: Failed to set modification time of cached file: chtimes /home/darthshadow/rclone/vfs/StorjDrive2/vfs/StorjZen-2/storage/blobs/pmw6tvzmf2jv6giyybmmvl4o2ahqlaldsaeh
a4yx74n5aaaaaaaa/hk/qich57lbblrcv75tligqhvnwrhkdvxdvb4q35uzrbmppx5n47q.sj1: no such file or directory
2020/07/01 19:32:06 ERROR : storage/blobs/pmw6tvzmf2jv6giyybmmvl4o2ahqlaldsaeha4yx74n5aaaaaaaa/hk/qich57lbblrcv75tligqhvnwrhkdvxdvb4q35uzrbmppx5n47q.sj1: vfs
cache: setModTime: failed to save item info: vfs cache item: failed to write metadata: open /home/darthshadow/rclone/vfs/StorjDrive2/vfsMeta/StorjZen-2/storage/blobs/pmw6tvzmf2jv6giyybmmvl4o2ahqlaldsaeha4yx74n5aaaaaaaa/hk/qich57lbblrcv75tligqhvnwrhkdvxdvb4q35uzrbmppx5n47q.sj1: no such file or directory

```

Let me know if you need the reproduction steps so I can enable debug logging for getting those.

---

<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:** [July 2, 2020, 1:43pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/192 "2020-07-02T13:43:37Z")

</div>

> [@darthShadow](#):
>
> I would still prefer the post-upload rename if you can make it work because the rename sometimes happens a couple of minutes into the upload which is wasted bandwidth. However, if there are edge cases with that which are difficult to resolve, then this approach is fine with me too, as long as it's not uploaded completely twice.

OK I'll have a think

> [@darthShadow](#):
>
> This is with Radarr which writes partial files and then renames it to the non-partial variant after the write is done.

Can you work out the exact sequence of events here?

Is it this

- Radarr opens partial
- Radarr writes to file
- Radarr closes file
- 5 seconds pass
- Rclone starts upload
- 2 minutes pass
- Radarr renames partial file

Or this - names radarr closes the file just before the rename. That is what I'd expect it to do.

If rclone is uploading the file when it is still open then that is a bug unless the file hasn't been modified.

- Radarr opens partial
- Radarr writes to file
- 5 seconds pass
- Rclone starts upload
- 2 minutes pass
- Radarr closes file
- Radarr renames partial file

I guess this is a plausible sequence with radarr re-opening the file but not writing to it. You should be able to tell what is happening from the DEBUG logs.

- Radarr opens partial
- Radarr writes to file
- Radarr closes file
- 5 seconds pass
- Rclone starts upload
- Radarr opens partial
- 2 minutes pass without radarr writing data
- Radarr closes file
- Radarr renames partial file

> [@darthShadow](#):
>
> The cache expiry log was info level earlier too, so I am not sure whether you want to make it debug now. It may be useful for someone. My only interest is to reduce the number of logs unless there is a case where the actual file and its metadata can expire at different times.

OK I made the metadata expiry a debug. It is unlikely you'll see anything but them both being removed in normal operation so I think debugging the metadata removal is a good idea.

> [@darthShadow](#):
>
> Let me know if you need the reproduction steps so I can enable debug logging for getting those.

If you can work out a sequence to repro that, that would be super helpful. I tried some obvious things but I couldn't reproduce the error.

---

<div class="post-metadata">

**Author:** ![random404](https://forum.rclone.org/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@random404](https://forum.rclone.org/u/random404)\
**Post date:** [July 2, 2020, 6:00pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/193 "2020-07-02T18:00:45Z")

</div>

> [@ncw](#):
>
> These don't affect memory use at all - they are the chunk sizes rclone requests from the upstream so you can make them bigger or use the defaults.

I was speaking about network bandwidth, I don't really care about memory usage.

So I finally updated my mounts!! With this settings:

> --user-agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36'   
> --config=/home/user/.config/rclone/rclone.conf   
> --allow-other   
> --fast-list   
> --vfs-read-chunk-size=10M   
> --vfs-read-chunk-size-limit=0   
> --buffer-size=0   
> --poll-interval=1m   
> --no-modtime   
> --drive-pacer-min-sleep=10ms   
> --dir-cache-time=24h   
> --timeout=10m   
> --umask=002   
> --union-search-policy=eprand   
> --log-level DEBUG   
> --log-file /opt/rclone.log   
> --async-read=false   
> --vfs-cache-mode full   
> --vfs-cache-max-size 800G   
> --vfs-cache-max-age 72h   
> --cache-dir /mnt/cache   
> --rc   
> --rc-addr=localhost:5572   
> union: /mnt/remote

I think it's using much more bandwidth than before. Is it doing some kind of read ahead/async reading regardless of my settings?

I plan to share the impact of my API usage as soon I have enough data

Also I'm using `v1.52.2-192.g8d5bc7f2-beta` hopefully it's the right one!

---

<div class="post-metadata">

**Author:** ![random404](https://forum.rclone.org/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@random404](https://forum.rclone.org/u/random404)\
**Post date:** [July 2, 2020, 6:16pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/194 "2020-07-02T18:16:11Z")

</div>

UPDATE: Within less than 10 minutes I had to revert to old settings.

Files weren't opening at all, lots of buffering, I started seeing 403 errors in the log about being rate limited.

I don't know what I did wrong, or if I was using the wrong rclone version...but for me this cache mode didn't work ☹

---

<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:** [July 2, 2020, 8:57pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/195 "2020-07-02T20:57:17Z")

</div>

> [@random404](#):
>
> I think it's using much more bandwidth than before. Is it doing some kind of read ahead/async reading regardless of my settings?

With `--buffer-size 0` it shouldn't be doing any more readahead.

> [@random404](#):
>
> Also I'm using `v1.52.2-192.g8d5bc7f2-beta` hopefully it's the right one!

That should be a good version.

> [@random404](#):
>
> Within less than 10 minutes I had to revert to old settings.
> 
> Files weren't opening at all, lots of buffering, I started seeing 403 errors in the log about being rate limited.
> 
> I don't know what I did wrong, or if I was using the wrong rclone version...but for me this cache mode didn't work

I suspect the cache mode full could use more bandwidth but it shouldn't use that much more bandwidth. It is more CPU / disk IO intensive though and you told me that your servers are very busy so I suspect it might be more that that is the problem.

We'll get there in the end I'm sure!

---

<div class="post-metadata">

**Author:** ![hacktek](https://forum.rclone.org/user_avatar/forum.rclone.org/hacktek/32/2064_2.png) [@hacktek](https://forum.rclone.org/u/hacktek)\
**Post date:** [July 2, 2020, 10:33pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/196 "2020-07-02T22:33:31Z")

</div>

Does this mean that even if say you have a buffer-size set to 64M, if a program opens a file and reads something from say the first 5MB of it and then closes the file, only 5M or so will be read and then committed to cache and the rest of the buffer will not be filled unnecessarily (and also not committed to cache)?

EDIT: looking at the sizes in the cache it looks like this is indeed what happens.

---

<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:** [July 3, 2020, 9:13am UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/197 "2020-07-03T09:13:09Z")

</div>

> [@hacktek](#):
>
> Does this mean that even if say you have a buffer-size set to 64M, if a program opens a file and reads something from say the first 5MB of it and then closes the file, only 5M or so will be read and then committed to cache and the rest of the buffer will not be filled unnecessarily (and also not committed to cache)?

It depends on whether the program is reading faster than the network. If it is then it will keep up and the buffer will never have any excess in it. If not (let's say a video playing) then the excess network speed will fill up the buffer. This will be written to disk even if the program doesn't read it, so the transfer isn't wasted.

---

<div class="post-metadata">

**Author:** ![darthShadow](https://forum.rclone.org/user_avatar/forum.rclone.org/darthshadow/32/1322_2.png) [@darthShadow](https://forum.rclone.org/u/darthShadow)\
**Post date:** [July 3, 2020, 1:10pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/198 "2020-07-03T13:10:37Z")

</div>

> [@ncw](#):
>
> Can you work out the exact sequence of events here?

Sent the logs via PM. From what I can understand, it seems to be the 3rd possibility, i.e. opening partial without writing and then renaming it.

> [@ncw](#):
>
> OK I made the metadata expiry a debug. It is unlikely you'll see anything but them both being removed in normal operation so I think debugging the metadata removal is a good idea.

Great. Another enhancement would be to add a log for when the file has been copied to the cache. Perhaps the Copied logline can be used then, and instead, log something like "Uploaded" when the copy to the remote is done?

> [@ncw](#):
>
> If you can work out a sequence to repro that, that would be super helpful. I tried some obvious things but I couldn't reproduce the error.

Sent the logs via PM. Nothing obvious jumped out to me as the cause for it.

---

<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:** [July 3, 2020, 4:35pm UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/199 "2020-07-03T16:35:48Z")

</div>

> [@darthShadow](#):
>
> Sent the logs via PM. From what I can understand, it seems to be the 3rd possibility, i.e. opening partial without writing and then renaming it.

Yes it looks like it.

I've implemented a fix for this. I'm afraid it is a cancel and retry fix rather than delayed rename. I decided the latter was too complicated as we are now relying on the cache to be a true representation of what we want the remote to be, so we we delay the rename of the file it will have many knock-on consequences.

Here is the fix for that - let me know how it goes!

[v1.52.2-195-gf8137215-vfs-beta](https://beta.rclone.org/branch/v1.52.2-195-gf8137215-vfs-beta/) on branch [vfs](https://github.com/rclone/rclone/tree/vfs) (uploaded in 15-30 mins)

> [@darthShadow](#):
>
> Another enhancement would be to add a log for when the file has been copied to the cache. Perhaps the Copied logline can be used then, and instead, log something like "Uploaded" when the copy to the remote is done?

There isn't a moment when we say "the file is downloaded to the cache" at the moment, just streams of files which get opened etc. I could do a log the first time stuff got downloaded to the file maybe?

The "Copied" log lines come from `operations.Copy` which is the workhorse or rclone to copy two objects. If I changed logs I'd have to change them here which would affect all of rclone...

> [@darthShadow](#):
>
> Sent the logs via PM. Nothing obvious jumped out to me as the cause for it.

No me neither... Do you remove files from the cache externally? Or start a second rclone with the same VFS cache?

---

<div class="post-metadata">

**Author:** ![darthShadow](https://forum.rclone.org/user_avatar/forum.rclone.org/darthshadow/32/1322_2.png) [@darthShadow](https://forum.rclone.org/u/darthShadow)\
**Post date:** [July 4, 2020, 10:47am UTC](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905/200 "2020-07-04T10:47:38Z")

</div>

> [@ncw](#):
>
> Here is the fix for that - let me know how it goes!

Working well, thanks. Minor nitpick:  
There seem to be multiple error log entries for the context cancel, any chance they can be reduced? These 2 seem pretty similar too:

```auto
2020/07/04 12:13:25 INFO : file.partial~: vfs cache: upload cancelled sucessfully
2020/07/04 12:13:25 INFO : file.partial~: vfs cache: cancelled upload

```

* * *

> [@ncw](#):
>
> If I changed logs I'd have to change them here which would affect all of rclone...

That's a no-go then.

> [@ncw](#):
>
> I could do a log the first time stuff got downloaded to the file maybe?

That also wouldn't be very helpful since I want to see when the full file has gotten copied to the cache.

Can something be logged at the part where you add the files to the queue to be uploaded? I think that would be a pretty good point to indicate that the file has gotten copied fully.

* * *

> [@ncw](#):
>
> No me neither... Do you remove files from the cache externally? Or start a second rclone with the same VFS cache?

Neither of those. This happens on a regular mount.  
Btw, this used to happen with the older vfs cache too so not something that was introduced as part of these changes. Perhaps I should open a new thread about this?

[Previous page](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905.md?page=9)

[Next page](https://forum.rclone.org/t/testing-for-new-vfs-cache-mode-features/16905.md?page=11)
