Skip to content

Commit 96efb72

Browse files
Merge pull request #94 from EMCECS/bugfix-SDK-615
[SDK-615] LargeFileUploader throws CancellationException when paused
2 parents 05a2434 + e171337 commit 96efb72

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/main/java/com/emc/object/s3/LargeFileUploader.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,11 @@ public void doMultipartUpload() {
435435
try {
436436
resumeContext.getUploadedParts().put(future.get().getPartNumber(), future.get());
437437
} catch (ExecutionException e) { // unfortunately, we can't just catch CancellationException here
438+
// get the root cause
439+
Throwable t = e;
440+
while (t.getCause() != null && t.getCause() != t) t = t.getCause();
438441
// CancellationException is only thrown when we are terminated early - cancelled tasks will just be ignored
439-
if (e.getCause() == null || !(e.getCause() instanceof CancellationException)) throw e;
442+
if (!(t instanceof CancellationException)) throw e;
440443
}
441444
}
442445

0 commit comments

Comments
 (0)