Skip to content

fix: check HTTP status code and fix concurrent fetch race#34

Merged
rjan90 merged 1 commit into
filecoin-project:masterfrom
beck-8:fix/check-http-status-code
Mar 26, 2026
Merged

fix: check HTTP status code and fix concurrent fetch race#34
rjan90 merged 1 commit into
filecoin-project:masterfrom
beck-8:fix/check-http-status-code

Conversation

@beck-8

@beck-8 beck-8 commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

@rjan90 rjan90 requested a review from Kubuxu March 26, 2026 12:45
@rjan90

rjan90 commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Hmmmm... It looks like this PR exposed an existing race in concurrent param fetches:

TestGetParamsParallel runs multiple GetParams calls against the same cache dir. One caller finishes downloading a file, then a slower waiter retries the same file with Range: bytes=<full-file-size>-, and the gateway returns 416 Requested Range Not Satisfiable. Before this change that response was getting misclassified later as a checksum problem; now we correctly return the real HTTP error, so the existing race shows up in CI.

The smallest fix is probably to treat 416 as “the local file may already be complete” and re-validate the existing file before failing.

@beck-8 beck-8 force-pushed the fix/check-http-status-code branch from 127cc9f to 0f0b71c Compare March 26, 2026 15:04
@beck-8 beck-8 changed the title fix: return HTTP error on bad status instead of checksum mismatch fix: check HTTP status code and fix concurrent fetch race Mar 26, 2026
@beck-8 beck-8 force-pushed the fix/check-http-status-code branch from 0f0b71c to 97618cb Compare March 26, 2026 15:09
@rjan90 rjan90 merged commit 28318fc into filecoin-project:master Mar 26, 2026
7 checks passed
@beck-8 beck-8 deleted the fix/check-http-status-code branch March 26, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants