Repository navigation
Conversation
- Extract range open error handling into `writeRangeOpenError` helper - Return `503 Service Unavailable` with `Retry-After: 1` for `errs.TemporaryCapacity` errors - Default to `500 Internal Server Error` instead of `416` when no HTTP status code error is present - Preserve existing `HttpStatusCodeError` status code behavior
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.
在以前的实现中(参见 893457c fix(aliyundrive): limit callback concurrency (#3071)) PR ,此 PR 补上用并发 Range 读取的aliyun 盘返回错误的问题,它修复了 S3 ,具体修复了什么此处不再赘述。但是这个 PR 的 503 映射只服务了 S3 端口,并未服务 webdav 等原始路径,默认分支就是 416。
所以 PR 自己定的「容量压力 ≠ 永久错误」在 WebDAV 上是失效的,backrest 就是这么中招的 :D
驱动返回的 TemporaryCapacity 不属于 HttpStatusCodeError,因此被写成 416。416 的语义是「你要的 Range 不存在」,restic 收到后会当成对象层面的错误,不去重试。
/ 此 PR 包含破坏性变更。
/ 此 PR 修改了公开 API、配置、存储格式或迁移行为。
/ 此 PR 需要关联仓库同步修改。
现在ServeHTTP 的错误映射能正常处理这个错误,返回 503 和 Retry after,其他打开失败返回 500 。
restic 拿到 503 会退避重试,而不是判定包坏了。对于check/prune 不再因为并发抢不到许可就整体失败。真正越界的 Range 还是 416
Testing / 测试
go test ./...Checklist / 检查清单
/ 我已阅读 CONTRIBUTING。
/ 我确认此贡献符合仓库许可证、贡献规范和行为准则。
gofmt,go fmt, orprettierwhere applicable./ 我已按适用情况使用
gofmt、go fmt或prettier格式化变更代码。/ 我已在适用情况下请求相关维护者或代码所有者审查。
AI Disclosure / AI 使用声明
/ 此 PR 包含 AI 辅助内容。
Tools used / 使用工具:
我使用了 claude Opus 5-5 审查可能的错误范围,并对齐进行修复后使用 DeepSeek 4.1 1017 进行 PR 编写引导。
/ 我已审核并验证此 PR 中的所有 AI 辅助内容。
Co-Authored-Byattribution./ 我已确保所有 AI 辅助提交都包含
Co-Authored-By归属信息。/ 我可以在没有任何 AI 工具的情况下重现此 PR 中包含的所有 AI 辅助内容。