Conversation
2 tasks
radamhub
force-pushed
the
fix/link-transient-error-category
branch
from
July 30, 2026 15:50
63214b1 to
dcfa81e
Compare
7 tasks
…anent ErrorCodeToLinkError maps 429/503 to CategoryRetryable and every unrecognised code to CategoryPermanent. On the link-validation path only ShouldDisableAccount() and ShouldRefetch() are consulted, so a Retryable error is acted on by neither: it falls through and the failure is memoised against the download URL. When a provider derives that URL deterministically the cache key never rotates, so a rate limit becomes as permanent as a hard failure and the file stays unreadable for the rest of the process lifetime. Map 429/503 and 500/502/504 to Refetchable, and default unknown codes to Refetchable as well: an unrecognised code is not evidence of permanent failure. Refetchable is the only category that drops the memoised entry and returns a fresh link, and it does not re-validate, so it cannot loop. Genuinely permanent codes (401/404/link_not_found/file_not_available) are unchanged. This is the mechanism behind reports where playback works, then stops, and only restarting the container fixes it. Adds a unit test asserting both directions: transient codes refetch, permanent codes stay permanent.
radamhub
force-pushed
the
fix/link-transient-error-category
branch
from
July 30, 2026 15:58
dcfa81e to
db5a8fd
Compare
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.
📌 Description
Reported in #179.
Target Branch Check (IMPORTANT)
Expected target:
Changes Made
In
ErrorCodeToLinkError(pkg/manager/link/errors.go):429and503:CategoryRetryable→CategoryRefetchable. On the link-validation path onlyShouldDisableAccount()andShouldRefetch()are consulted, andCategoryRetryableis acted on by neither, so the error falls through and the failure is memoised against the download URL. When a provider derives that URL deterministically the cache key never rotates, which makes a rate limit exactly as permanent as a hard failure.500,502,504asRefetchablefor the same reason.default:CategoryPermanent→CategoryRefetchable. An unrecognised code is not evidence of permanent failure, andCategoryPermanentmeans neither retry nor refetch, so a single transient400poisons the file until the process restarts.401/unauthorized,404,link_not_found,file_not_available, and the account/quota codes.pkg/manager/link/errors_category_test.goasserting both directions.Refetchableis the right category here because it is the only one that drops the memoised entry and returns a fresh link, and it does so without re-validating, so it cannot loop.Testing
Steps:
go test ./pkg/manager/link/ -run TestTransientCodesAreRefetchable -vpasses with the change. Without it,400and unknown codes are reported permanent and429/503do not refetch.502during validation left files unreadable while the very same HEAD request returned200when retried by hand. I reproduced that three times. After the change, those files recover on their own without restarting the container.404is not retried in a loop.Risks / Notes
Checklist