Large file upload reports a failed part only after all other parts finish

未关闭
#237 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
66/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
java
领域
cloud

调研方向

Start in core/src/main/java/com/backblaze/b2/client/B2LargeFileStorer.java at storePartsAsync, where the allOf(...) near line 361 waits for every part. Compare how B2LargeFileUploader.java (around lines 249-251) cancels the remaining futures when one fails. Done when a failing part cancels its siblings and the error surfaces without waiting for slow parts, which a test with one failing and one slow part storer can show.

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

描述

What happens

B2LargeFileStorer.storePartsAsync() waits for every part with CompletableFuture.allOf, which only completes after all part futures are done, and it does not cancel the remaining parts when one fails. If a part fails early, the caller keeps waiting while the other parts upload to the end, then gets the error. B2LargeFileUploader handles this differently and cancels the other futures when one fails.

Where

core/src/main/java/com/backblaze/b2/client/B2LargeFileStorer.java:361 (allOf(...) in storePartsAsync); compare core/src/main/java/com/backblaze/b2/client/B2LargeFileUploader.java:249-251, which calls cancel(true) on the remaining futures.

Why it matters

Impact: Wrong request or result (the error is delayed and bandwidth is spent on a file that cannot be finished), loud. Severity: High, because it happens on the normal path whenever a part upload fails during a multi-part upload, and the caller has no way to stop the remaining parts early.

How to check

Found by reading the code, not reproduced. Read storePartsAsync: the returned future is built on allOf, and nothing cancels sibling futures or sets the cancellation token on the first failure. A test with one failing part storer and one slow part storer should show the error arriving only after the slow part completes.

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 摘要。