Github user kishorvpatil commented on a diff in the pull request:
https://github.com/apache/storm/pull/2925#discussion_r240759159
--- Diff:
storm-client/src/jvm/org/apache/storm/dependency/DependencyUploader.java ---
@@ -154,11 +154,23 @@ private boolean uploadDependencyToBlobStore(String
key, File dependency)
acls.add(new AccessControl(AccessControlType.OTHER,
BlobStoreAclHandler.READ));
- AtomicOutputStream blob = getBlobStore().createBlob(key, new
SettableBlobMeta(acls));
- Files.copy(dependency.toPath(), blob);
- blob.close();
+ AtomicOutputStream blob = null;
+ try {
+ blob = getBlobStore().createBlob(key, new
SettableBlobMeta(acls));
+ Files.copy(dependency.toPath(), blob);
+ blob.close();
+ blob = null;
- uploadNew = true;
+ uploadNew = true;
+ } finally {
+ try {
+ if (blob != null) {
+ blob.cancel();
+ }
+ } catch (IOException throwaway) {
+ // Ignore.
--- End diff --
It would be useful to log Error/warning in case there is `IOException`.
---