Skip to content

fix(s3stream): skip waiting for pending part on release (#2316) #2319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,13 @@ public CompletableFuture<Void> close() {

@Override
public CompletableFuture<Void> release() {
List<CompletableFuture<AbstractObjectStorage.ObjectStorageCompletedPart>> partsToWait = parts;
if (objectPart != null) {
// skip waiting for pending part
partsToWait = partsToWait.subList(0, partsToWait.size() - 1);
}
// wait for all ongoing uploading parts to finish and release pending part
return CompletableFuture.allOf(parts.toArray(new CompletableFuture[0])).whenComplete((nil, ex) -> {
return CompletableFuture.allOf(partsToWait.toArray(new CompletableFuture[0])).whenComplete((nil, ex) -> {
if (objectPart != null) {
objectPart.release();
}
Expand Down