fix(quark): recover transient upload control errors - #9643
Open
NovumOrbis wants to merge 1 commit into
Open
Conversation
Add bounded, stage-aware retries for known Quark upload control-plane transients. Defer finish visibility recovery until the retry budget is exhausted, verify only the exact upload FID through a raw context-aware /file/sort probe, fail closed when FID is unavailable, cap visibility pagination, and cover replay/cancellation safety with regression tests.
NovumOrbis
force-pushed
the
fix/quark-upload-reliability
branch
from
September 6, 2026 16:32
21e2250 to
ff17adb
Compare
NovumOrbis
marked this pull request as ready for review
September 7, 2026 02:42
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.
Problem
Quark can return transient control-plane errors during an otherwise valid
multipart upload.
Two failures were observed in a real Synology Hyper Backup -> AList -> Quark
workload:
complete_upload_lock_timeoutfrom/file/upload/finishinner error, requestId ...from/file/update/hashPreviously either error aborted the WebDAV PUT and surfaced to Hyper Backup as
a generic destination/permission-style failure.
Fix
Add bounded, stage-aware recovery around known Quark upload control-plane
transients:
pre,hash,part,commit,finish)transient messages
/file/upload/pre, because replaying precan allocate another task/FID
sent
/file/upload/finishretry budget before consultingdirectory visibility
a last-resort tiebreaker
/file/upload/prebe established
/file/sortverification probecontext.Contextinto verification requestsSafety
The retry matcher is deliberately bounded and prefix-anchored.
Token extensions such as:
complete_upload_lock_timeout_but_othercomplete_upload_lock_timeoutsinner errors, requestId ...inner error_x, requestId ...are rejected.
Formatted OSS errors such as
up status: ..., generic transport errors,permission failures, and same-name conflicts are not retried by this
driver-layer wrapper.
/file/upload/preis intentionally not given an additional driver-layer retry.AList's shared
base.RestyClientstill has a pre-existing transport-level retrypolicy below this code. This PR does not change that behavior and therefore
does not claim that provider or OSS requests can never be replayed at the
transport layer.
For finish recovery, visibility success is accepted only after the bounded
finish retry budget is exhausted and only when
/file/sortreturns the exactpre-allocated regular-file FID.
Residual provider-semantic uncertainties remain:
pre-allocated FID after a finish error is a documented terminal durability
signal
/file/update/hashand/file/upload/finishisnot formally documented here
scope for this PR
Validation
Regression coverage includes:
Post-audit fork validation based on this exact code, with only a temporary CI
workflow file added, passed:
gofmtgo vet ./drivers/quark_ucgo test ./drivers/quark_ucgo test -race ./drivers/quark_ucgo test -race -shuffle=on -count=2 ./drivers/quark_ucgo test ./internal/op ./server/webdavbuildrelease_dockerReal-world validation note
The DS923+ / Hyper Backup evidence belongs to the earlier combined test
candidate:
26bc4f937a213f44437a5db9a8318e9d317fae53not to the current upstream-facing head:
ff17adb98c55c8787a66e30c893841cdf3e04751That earlier real workload:
complete_upload_lock_timeoutencountered duringfinishinner error, requestId ...duringhashThe final upstream-facing head further hardens finish recovery by exhausting
the finish retry budget before using exact-FID visibility as a last-resort
tiebreaker. That final fallback ordering has not itself been independently
deployed to the NAS.
Related mkdir-visibility fix: #9642. The two PRs arose from the same Hyper
Backup incident but address separate failure mechanisms.