Repository navigation
feat: add S3 SlowDown error - #1
Merged
Merged
Conversation
This was referenced Sep 10, 2026
jyxjjj
requested changes
Sep 11, 2026
Author
|
I agree, it seems creating latent wrapper. @jyxjjj |
- populate ErrorCode responses from the canonical message table - preserve literal messages for unmapped codes and exercise the direct SlowDown path
jyxjjj
approved these changes
Sep 11, 2026
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.
Summary
ErrSlowDownPlease reduce your request rate.and HTTP 503ErrorCoderesponses from known canonical messages while preserving the literal fallback for unmapped codesMotivation
Backends need a protocol-correct way to report temporary capacity exhaustion instead of exposing it as an internal server error. This is needed by the OpenList callback-download work discussed in OpenListTeam/OpenList#2969.
The code, message, and status follow the Amazon S3 error response reference.
Validation
go test . -run '^(TestSlowDownError|TestSlowDownHTTPResponse|TestUnknownErrorCodeDefaultsToInternalServerError)$' -count=1go test ./... -count=1CGO_ENABLED=1 CC=clang go test -race ./... -count=1(Windows amd64, LLVM Clang 22.1.8)go vet ./...go install ./...go run golang.org/x/vuln/cmd/govulncheck@latest ./...(No vulnerabilities found)gofmt -d error.go error_test.gogit diff --checkgolangci-lintcould not provide a valid result against the repository baseline: v2.13.2 rejects the existing v1-format.golangci.yml, while v1.64.8 cannot read Go 1.27 export data. Both fail during tool/config loading before analyzing this change; no lint configuration is changed by this PR.AI assistance
Codex assisted with drafting and test implementation. The final diff was reviewed against the current gofakes3 error boundary and the AWS S3 reference, and the commands above were run on Go 1.27.0.