zookeeper-dev mailing list archives

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

    https://github.com/apache/zookeeper/pull/356#discussion_r136739382
  
    --- Diff: src/java/main/org/apache/zookeeper/server/quorum/Learner.java ---
    @@ -395,11 +395,12 @@ else if (qp.getType() == Leader.SNAP) {
                     //we need to truncate the log to the lastzxid of the leader
                     LOG.warn("Truncating log to get in sync with the leader 0x"
                             + Long.toHexString(qp.getZxid()));
    -                boolean truncated=zk.getZKDatabase().truncateLog(qp.getZxid());
    -                if (!truncated) {
    +                try {
    +                    zk.getZKDatabase().truncateLog(qp.getZxid());
    +                } catch (IOException e) {
                         // not able to truncate the log
    -                    LOG.error("Not able to truncate the log "
    -                            + Long.toHexString(qp.getZxid()));
    +                    LOG.error("Not able to truncate the log {}, Unexpected exception
"
    +                            + Long.toHexString(qp.getZxid()), e);
                         System.exit(13);
    --- End diff --
    
    update


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message