{{ message }}
vfs/vfscache: don't discard a clean cached file when the remote lookup is unconfirmed#9531
Open
sjluppino wants to merge 1 commit into
Open
vfs/vfscache: don't discard a clean cached file when the remote lookup is unconfirmed#9531sjluppino wants to merge 1 commit into
sjluppino wants to merge 1 commit into
Conversation
…p is unconfirmed
_checkObject treated a nil remote object as a confirmed deletion and removed the
clean cached file ("stale (remote deleted)"), so the next read returned 0 bytes.
But o is also nil when the directory listing was successful but incomplete - an
eventually consistent backend, a stale negative right after a remount, or a proxy
returning empty without an error - so o == nil arrives with no error to signal it.
A genuine connection failure already surfaces as an I/O error via list.DirSorted,
so that case is unaffected.
Re-confirm with NewObject before acting on the nil, the same way the download path
already does:
- ErrorObjectNotFound / ErrorIsDir -> remove as before (deletion propagation)
- other (transient) error -> keep the cached file; its fingerprint matched when
written, so serving it is safe
- success -> fingerprint-check it like the normal path
This does not cure eventual consistency: if both the listing and the NewObject HEAD
return a stale negative in the same window, the item is still discarded.
Fixes rclone#9530
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

In
_checkObject, anilremote object was treated as a confirmed deletion and the clean cached file was removed (stale (remote deleted)), so the next read returned 0 bytes. Butois alsonilwhen the directory listing was successful but incomplete — an eventually-consistent backend, a stale negative right after a remount, or a proxy returning empty-without-error — soo == nilarrives with no error to signal it. (A genuine connection failure already surfaces as an I/O error vialist.DirSorted, so that case isn't affected.)This re-confirms with
NewObjectbefore acting on thenil, the same pattern the download path already uses (#6190/#6235):ErrorObjectNotFound/ErrorIsDir→ remove as before (deletion propagation preserved)It does not cure eventual consistency: if both the listing and the
NewObjectHEAD return a stale negative in the same window, the item is still discarded. It fixes the transient-error and "list stale but HEAD authoritative" cases.Adds two tests (transient → kept,
ErrorObjectNotFound→ removed) andTestItemReloadRemoteGonestill passes as the deletion-propagation regression guard.Fixes #9530