Repository navigation
fix(collaboration): retry GetFile downloads while the file is in postprocessing - #4108
Open
pbleser-oc wants to merge 1 commit into
Open
pbleser-oc wants to merge 1 commit into
pbleser-oc wants to merge 1 commit into
Conversation
…processing With asynchronous uploads, a new file version is in postprocessing for a short while after a PutFile, and the download from the data gateway answers "425 Too Early" until it is done. GetFile turned that into a 500, which made the WOPI validator test EditFlows/BasicEdit fail now and then, and which office apps get when they reload a document right after a save. Retry the download on a 425 up to 6 times, waiting from 20ms up to 640ms between the attempts (1.26s in total), and stop early when the request is canceled. If the file is still in postprocessing after that, GetFile answers 500 as before. Fixes opencloud-eu#4106 Assisted-by: Claude Code:claude-opus-5-5
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 11 |
🟢 Coverage 90.63% diff coverage · +0.00% coverage variation
Metric Results Coverage variation ✅ +0.00% coverage variation (-1.00%) Diff coverage ✅ 90.63% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (dc749a3) 94500 28684 30.35% Head commit (178153a) 94523 (+23) 28695 (+11) 30.36% (+0.00%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#4108) 32 29 90.63% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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
GetFilein the collaboration service now retries the download when the data gateway answers425 Too Early: up to 6 times, waiting from 20ms up to 640ms between the attempts (1.26s in total), and it stops early when the request is canceled. If the file is still in postprocessing after that, it answers500as before.Limitation: this covers fast postprocessing only, as in the CI. Servers with longer postprocessing steps, such as a virus scan, can still run out of retries. How to handle those needs a team decision: #4107.
Related Issue
Motivation and Context
With asynchronous uploads, a new file version is in postprocessing for a short while after a
PutFile, and the download answers425until it is done.GetFileturned every download status other than 200 into a500. That made the WOPI validator testEditFlows/BasicEditfail now and then in the CI, and office apps that reload a document right after a save get the same500.How Has This Been Tested?
go test -race ./services/collaboration/pkg/connector/..., 5 runs425twice, then succeeds425: 7 attempts, then500Types of changes
Checklist:
AI assistance: Claude Code (claude-opus-5-5) wrote the first draft of the code, the tests and this description; I reviewed them.