You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by iv...@apache.org on 2018/11/21 17:25:05 UTC

[bookkeeper] branch master updated: AbstractZkLedgerManager should catch all exceptions from parseConfig

This is an automated email from the ASF dual-hosted git repository.

ivank pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 79bb0b1  AbstractZkLedgerManager should catch all exceptions from parseConfig
79bb0b1 is described below

commit 79bb0b1c8570359b2ac9b1e4a5c84ac3eca93496
Author: Ivan Kelly <iv...@apache.org>
AuthorDate: Wed Nov 21 18:24:59 2018 +0100

    AbstractZkLedgerManager should catch all exceptions from parseConfig
    
    And always complete the request if an exception does occur, rather
    than throwing it out to the higher level, and hanging the request
    forever.
    
    
    Reviewers: Enrico Olivelli <eo...@gmail.com>
    
    This closes #1824 from ivankelly/catch-all-exception-zk
---
 .../main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java
index a23c330..b5bea64 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java
@@ -402,8 +402,8 @@ public abstract class AbstractZkLedgerManager implements LedgerManager, Watcher
                     LongVersion version = new LongVersion(stat.getVersion());
                     LedgerMetadata metadata = LedgerMetadata.parseConfig(data, Optional.of(stat.getCtime()));
                     promise.complete(new Versioned<>(metadata, version));
-                } catch (IOException e) {
-                    LOG.error("Could not parse ledger metadata for ledger: " + ledgerId, e);
+                } catch (Throwable t) {
+                    LOG.error("Could not parse ledger metadata for ledger: {}", ledgerId, t);
                     promise.completeExceptionally(new BKException.ZKException());
                 }
             }