You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2020/07/24 09:04:19 UTC

[GitHub] [bookkeeper] mino181295 commented on a change in pull request #2384: Track ZooKeeper errors as causes of ZKException

mino181295 commented on a change in pull request #2384:
URL: https://github.com/apache/bookkeeper/pull/2384#discussion_r459935027



##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java
##########
@@ -444,12 +444,13 @@ public void processResult(int rc, String path, Object ctx, byte[] data, Stat sta
                 if (rc != KeeperException.Code.OK.intValue()) {
                     LOG.error("Could not read metadata for ledger: " + ledgerId,
                               KeeperException.create(KeeperException.Code.get(rc), path));
-                    promise.completeExceptionally(new BKException.ZKException());
+                    promise.completeExceptionally(new BKException.ZKException(KeeperException.create(Code.get(rc), path)));
                     return;
                 }
                 if (stat == null) {
                     LOG.error("Could not parse ledger metadata for ledger: {}. Stat object is null", ledgerId);
-                    promise.completeExceptionally(new BKException.ZKException());
+                    promise.completeExceptionally(new BKException.ZKException(
+                            new Exception("Could not parse ledger metadata for ledger: "+ledgerId+" . Stat object is null").fillInStackTrace()));

Review comment:
       Checkstyle?

##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java
##########
@@ -459,7 +460,8 @@ public void processResult(int rc, String path, Object ctx, byte[] data, Stat sta
                     promise.complete(new Versioned<>(metadata, version));
                 } catch (Throwable t) {
                     LOG.error("Could not parse ledger metadata for ledger: {}", ledgerId, t);
-                    promise.completeExceptionally(new BKException.ZKException());
+                    promise.completeExceptionally(new BKException.ZKException(
+                            new Exception("Could not parse ledger metadata for ledger: "+ledgerRootPath, t).fillInStackTrace()));

Review comment:
       Checkstyle?




----------------------------------------------------------------
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