Github user d2r commented on a diff in the pull request:
https://github.com/apache/storm/pull/2925#discussion_r240369252
--- Diff: storm-client/src/jvm/org/apache/storm/blobstore/BlobStore.java ---
@@ -288,13 +288,15 @@ public void createBlob(String key, InputStream in,
SettableBlobMeta meta, Subjec
while ((len = in.read(buffer)) > 0) {
out.write(buffer, 0, len);
}
- out.close();
- } catch (AuthorizationException | IOException | RuntimeException
e) {
- if (out != null) {
- out.cancel();
- }
} finally {
- in.close();
+ try {
+ if (out != null) {
--- End diff --
I see what you mean. We need to preserve a distinction between cleaning up
in the normal case and cleaning up in the error case.
In the normal case, we want `close`. In the error case, we want `cancel`.
---