Skip to content

feat: add S3 SlowDown error - #1

Merged
jyxjjj merged 2 commits into
OpenListTeam:masterfrom
nostalume:feat/slow-down-error
Sep 11, 2026
Merged

jyxjjj merged 2 commits into
OpenListTeam:masterfrom
nostalume:feat/slow-down-error

Conversation

@nostalume

@nostalume nostalume commented Sep 10, 2026 •

Copy link
Copy Markdown

Summary

  • add the public S3 error code ErrSlowDown
  • map it to the AWS message Please reduce your request rate. and HTTP 503
  • populate direct ErrorCode responses from known canonical messages while preserving the literal fallback for unmapped codes
  • cover the error metadata, the real backend-style HTTP/XML response path, and the existing unknown-code fallback

Motivation

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=1
  • go test ./... -count=1
  • CGO_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.go
  • git diff --check

golangci-lint could 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.

Comment thread error_test.go Resolved
@nostalume

nostalume commented Sep 11, 2026 •

Copy link
Copy Markdown
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
jyxjjj merged commit cd3c030 into OpenListTeam:master Sep 11, 2026
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