Failed HEAD request drops Retry-After and the error code and message
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 74/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- java
- 领域
- api, networking
调研方向
从 httpclient/src/main/java/com/backblaze/b2/client/webApiHttpClient/B2WebApiHttpClientImpl.java 开始:阅读 head() 中处理非 200 响应的 else 分支(约第 178 行),并与第 286 行的 POST 路径、extractExceptionFromErrorResponse 以及 getRetryAfterSecondsOrNull(约第 303-314 行)进行比较。让 HEAD 失败像 POST 一样携带错误码、消息和 Retry-After。完成标准:模拟一个带 Retry-After: 7 的 503 HEAD 响应后,getRetryAfterSecondsOrNull() 返回 7,并且错误码和消息已被填充。
由索引模型根据 Issue 内容生成。
描述
What happens
When B2WebApiHttpClientImpl.head() gets a status other than 200, it throws B2Exception.create(null, statusCode, null, ""). The error has no code and an empty message, and the Retry-After header is ignored, so a 429 or 503 on a HEAD request is retried with the default delay rather than the server's. The POST path keeps all of these.
Where
httpclient/src/main/java/com/backblaze/b2/client/webApiHttpClient/B2WebApiHttpClientImpl.java:178 (head); compare :286 and :303-314 (getRetryAfterSecondsOrNull) used by the POST path.
Why it matters
Impact: Wrong request or result (a poorer error and wrong retry delay), loud. Severity: High, because it happens on every failed HEAD request (normal path for errors), and there is no workaround besides reading the status code from the exception.
How to check
Found by reading the code, not reproduced. Read the else branch in head() and compare it with extractExceptionFromErrorResponse. A test with a mock HTTP client returning 503 with Retry-After: 7 on a HEAD should show getRetryAfterSecondsOrNull() as null.
Version
Seen at v6.5.0. Present on the default branch: present.
- 主要语言
- Java
- 星标
- 103
- 派生
- 23
- 平均合并
- 5 天 8 小时
- 30 天内合并 PR
- 3
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Backblaze/b2-sdk-java 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
Backblaze/b2-sdk-java#248 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
Backblaze/b2-sdk-java#246 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
Backblaze/b2-sdk-java#245 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
Backblaze/b2-sdk-java#242 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
Backblaze/b2-sdk-java#241 ·
维护者通常 3 天内回复
查看 Backblaze/b2-sdk-java 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
IETF-Hackathon/pqc-certificates#351 ·
维护者通常 2 天内回复
-
bug(core): skip_nodes.json is missing SELECT and PRE, causing Python and Java to insert separators into dropdown options and preformatted text可能已有人在做 @Bhumit267 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
ExceptionThrowShouldUseContext: NullPointerException on a catch block inside an annotation type可能已有人在做 @Carbon14-48 今天认领。 未关闭approved
难度 2/5 1-3 小时 新手友好度 72/100
checkstyle/checkstyle#22784 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复