You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2021/04/06 18:19:40 UTC

[GitHub] [zookeeper] kelloggm commented on a change in pull request #1638: ZOOKEEPER-4246: Resource leaks in org.apache.zookeeper.server.persistence.SnapStream#getInputStream and #getOutputStream

kelloggm commented on a change in pull request #1638:
URL: https://github.com/apache/zookeeper/pull/1638#discussion_r608080517



##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/persistence/SnapStream.java
##########
@@ -104,10 +104,20 @@ public static CheckedInputStream getInputStream(File file) throws IOException {
         InputStream is;
         switch (getStreamMode(file.getName())) {
         case GZIP:
-            is = new GZIPInputStream(fis);
+            try {

Review comment:
       I've made this change. Would you all also prefer one `try` around the entire `switch` in the other method, where only one of the `case`s can throw? It would make the code look more symmetrical, but it's otherwise unnecessary.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org