Skip to content

Commit

Permalink
Merge pull request #94 from EMCECS/bugfix-SDK-615
Browse files Browse the repository at this point in the history
[SDK-615] LargeFileUploader throws CancellationException when paused
  • Loading branch information
twincitiesguy authored Aug 22, 2022
2 parents 05a2434 + e171337 commit 96efb72
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/com/emc/object/s3/LargeFileUploader.java
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,11 @@ public void doMultipartUpload() {
try {
resumeContext.getUploadedParts().put(future.get().getPartNumber(), future.get());
} catch (ExecutionException e) { // unfortunately, we can't just catch CancellationException here
// get the root cause
Throwable t = e;
while (t.getCause() != null && t.getCause() != t) t = t.getCause();
// CancellationException is only thrown when we are terminated early - cancelled tasks will just be ignored
if (e.getCause() == null || !(e.getCause() instanceof CancellationException)) throw e;
if (!(t instanceof CancellationException)) throw e;
}
}

Expand Down

0 comments on commit 96efb72

Please sign in to comment.