File tree 1 file changed +6
-1
lines changed
s3stream/src/main/java/com/automq/stream/s3/operator
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -161,8 +161,13 @@ public CompletableFuture<Void> close() {
161
161
162
162
@ Override
163
163
public CompletableFuture <Void > release () {
164
+ List <CompletableFuture <AbstractObjectStorage .ObjectStorageCompletedPart >> partsToWait = parts ;
165
+ if (objectPart != null ) {
166
+ // skip waiting for pending part
167
+ partsToWait = partsToWait .subList (0 , partsToWait .size () - 1 );
168
+ }
164
169
// wait for all ongoing uploading parts to finish and release pending part
165
- return CompletableFuture .allOf (parts .toArray (new CompletableFuture [0 ])).whenComplete ((nil , ex ) -> {
170
+ return CompletableFuture .allOf (partsToWait .toArray (new CompletableFuture [0 ])).whenComplete ((nil , ex ) -> {
166
171
if (objectPart != null ) {
167
172
objectPart .release ();
168
173
}
You can’t perform that action at this time.
0 commit comments