Large file upload interrupt error does not keep InterruptedException as cause

未关闭 适合新手
#236 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
88/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
java
领域
backend

调研方向

需要修改的两处 throw 是 core/src/main/java/com/backblaze/b2/client/B2LargeFileStorer.java 中第 286 行和第 338 行的 throw new B2LocalException("trouble", "interrupted exception");,分别位于 storeFile() 和 storeParts() 中。复制上方几行 ExecutionException 分支已经使用的带 cause 参数的重载,并传入捕获的 InterruptedException。当两处 throw 都保留 InterruptedException 作为 cause,且 core 模块中现有的测试仍然通过时,即完成。

由索引模型根据 Issue 内容生成。

描述

What happens

When storeFile() or storeParts() is interrupted, the B2LocalException that is thrown does not carry the InterruptedException as its cause, so the stack trace of the interrupt is lost. The other B2LocalException throws in the same methods do pass the cause.

Where

core/src/main/java/com/backblaze/b2/client/B2LargeFileStorer.java:286 and :338: throw new B2LocalException("trouble", "interrupted exception"); (the ExecutionException branch at :283 and :334 passes cause).

Why it matters

Impact: Docs and messages (less diagnostic detail), loud. Severity: Low, because it only loses diagnostic detail, the error itself is still thrown, and it needs an interrupt (unusual).

How to check

Found by reading the code, not reproduced. Read the two throw statements and compare with the constructor overload used a few lines above, which takes a cause.

Version

Seen at v6.5.0. Present on the default branch: present.

主要语言
Java
星标
103
派生
23
平均合并
5 天 8 小时
30 天内合并 PR
3

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Backblaze/b2-sdk-java 的其他 Issue

查看 Backblaze/b2-sdk-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。