adrianmo opened a new issue #1905: Masquerading ZK errors as generic ZKException
URL: https://github.com/apache/bookkeeper/issues/1905
 
 
   **BUG REPORT**
   
   1. Please describe the issue you observed:
   
   - What did you do?
   
   We are in the process of updating BookKeeper dependency in Pravega from 
4.5.0 to 4.7.3. In some tests, we try to create a Znode in a path that doesn't 
exist and expect to receive an exception accordingly.
   
   - What did you expect to see?
   
   We expect to see a 
[`KeeperException.NoNodeException`](https://github.com/apache/zookeeper/blob/branch-3.5/zookeeper-server/src/main/java/org/apache/zookeeper/KeeperException.java#L118),
 which is the original error thrown by the ZK client and it was preserved by BK 
4.5.
   
   - What did you see instead?
   
   Instead of a `NoNodeException`, we get the following.
   
   ```
   org.apache.bookkeeper.client.BKException$ZKException: Error while using 
ZooKeeper
        at 
org.apache.bookkeeper.discover.ZKRegistrationClient.lambda$getChildren$0(ZKRegistrationClient.java:212)
        at 
org.apache.bookkeeper.zookeeper.ZooKeeperClient$25$1.processResult(ZooKeeperClient.java:1174)
        at 
org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:619)
        at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:499)
   ```
   
   Looking at the code, it seems that BK is ignoring the return/error code from 
ZK and rethrowing a generic `ZKException` in 
https://github.com/apache/bookkeeper/blob/branch-4.7/bookkeeper-server/src/main/java/org/apache/bookkeeper/discover/ZKRegistrationClient.java#L211.
 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to