zymap commented on code in PR #4798:
URL: https://github.com/apache/bookkeeper/pull/4798#discussion_r3679599789
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeper.java:
##########
@@ -459,9 +459,11 @@ public BookKeeper(ClientConfiguration conf, ZooKeeper zk,
EventLoopGroup eventLo
log.error()
.exception(ce)
.log("Failed to initialize metadata client driver using
invalid metadata service uri");
+ close();
Review Comment:
I think it's better not to close it internally. It may throw an exception
that only happens in the close() method and misdirect the failure case.
Try-finally should be a better way to handle the close.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]