Repository navigation
vfs: add --vfs-downloader-idle-time and --vfs-downloader-max-errors - #10171
Conversation
…ixes rclone#10148 The idle time after which a cache downloader stops and the number of errors it tolerates were fixed at 5s and 10. A slow reader, such as audio streamed with --buffer-size 0, could see its downloader time out between reads, and a failing backend kept a mount busy until the error count was reached.
|
Friendly ping on this one: the |
|
The only red job is |
|
The only red check is |
|
A quick check-in on this one. I am happy to rename the flags or change the defaults if you prefer, and to look at the one failing linux_386 job if it traces back to this change. Thank you. |
|
Friendly ping for a review when someone has time. I am glad to rename the flags or change the defaults if you prefer different ones. |
|
Still waiting on a first review here. The branch is current and every check except the linux_386 one is green; that one is TestS3Minio, which does not touch these flags. Happy to rename the flags or change defaults if that helps. |
ncw
left a comment
There was a problem hiding this comment.
Looks nice - thank you :-)
Apart from some quibble about names this is ready to go - see inline!
| Help: "Time a cache downloader can be idle before it stops", | ||
| Groups: "VFS", | ||
| }, { | ||
| Name: "vfs_downloader_max_errors", |
There was a problem hiding this comment.
I think this should be called vfs_cache_downloader_max_errors
| Help: "Extra read ahead over --buffer-size when using cache-mode full", | ||
| Groups: "VFS", | ||
| }, { | ||
| Name: "vfs_downloader_idle_time", |
There was a problem hiding this comment.
I think this should be called vfs_cache_downloader_idle_time
| When using this mode it is recommended that `--buffer-size` is not set | ||
| too large and `--vfs-read-ahead` is set large if required. | ||
|
|
||
| A downloader which is not read from for `--vfs-downloader-idle-time` |
| WriteBack fs.Duration `config:"vfs_write_back"` // time to wait before writing back dirty files | ||
| ReadAhead fs.SizeSuffix `config:"vfs_read_ahead"` // bytes to read ahead in cache mode "full" | ||
| DownloaderIdleTime fs.Duration `config:"vfs_downloader_idle_time"` // time a downloader can be idle before it stops | ||
| MaxDownloadErrors int `config:"vfs_downloader_max_errors"` // errors a downloader tolerates before giving up |
There was a problem hiding this comment.
Make name consistent with flag so DownloaderMaxErrors
The flags are now --vfs-cache-downloader-idle-time and --vfs-cache-downloader-max-errors, and the option field is DownloaderMaxErrors, to match the other vfs cache options.
|
Thanks, all renamed in 97b5114: the flags are now |
What does this change do?
Makes the two VFS cache downloader limits from #10148 configurable.
--vfs-downloader-idle-timeis how long a downloader can sit idle before it stops (default 5s) and--vfs-downloader-max-errorsis how many errors it tolerates before giving up (default 10). Both defaults are the old constants, so nothing changes unless the flags are set.Streaming slowly with
--vfs-cache-mode fulland--buffer-size 0can leave more than 5s between reads, so the downloader stops with "stopping download thread as it timed out" and has to start again.Two new tests in
vfs/vfscache/downloaders: one sets the idle time to 50ms and checks an idle downloader stops, the other checks the error limit is read from the options, both when it is exceeded and when it is not. Thevfsdocs have a short paragraph on the two flags. Open point: I added a dedicated error limit rather than reusing--low-level-retriesas the issue suggests, because the downloader counts errors across reads, not retries of one call. Say if you would rather reuse it.Linked issue
Fixes #10148
Checklist