zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maoling <...@git.apache.org>
Subject [GitHub] zookeeper pull request #356: ZOOKEEPER-2572: Fix potential resource leak in ...
Date Tue, 05 Sep 2017 14:29:11 GMT
Github user maoling commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/356#discussion_r137003935
  
    --- Diff: src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java ---
    @@ -409,13 +409,15 @@ public void truncate(long zxid) throws IOException {
                     try {
                         Files.delete(itr.logFile.toPath());
                     } catch (NoSuchFileException e) {
    +                    LOG.info("An NoSuchFileException was thrown when delete file {}"
+
    +                    ", but will continue. Assume this file has been deleted successfully.",
itr.logFile);
                     }
                 }
             } finally {
    -            close(itr);
                 if (raf != null) {
                     raf.close();
    --- End diff --
    
    IMHO, `raf.close();`  should be surrounded with `try-catch` ?


---

Mime
View raw message