keith-turner commented on a change in pull request #1018: Fix #976 - Expand
overly broad Exceptions in Accumulo-core
URL: https://github.com/apache/accumulo/pull/1018#discussion_r271485925
##########
File path: core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java
##########
@@ -286,7 +286,7 @@ public void process(WatchedEvent event) {
else if (asyncLock != null)
failedToAcquireLock();
}
- } catch (Throwable e) {
+ } catch (KeeperException | InterruptedException e) {
Review comment:
I don't think this catch should be narrowed because any unexpected runtime
exception needs to be properly handled for zookeeper locks. We don't want to
ignore an NPE and think the lock is held when it is not.
I worry about the correctness of this change because of possible issues like
this. Narrowing could lead to handling runtime exceptions differently which in
some case could cause bugs. Its hard to review all of the narrowing for
correctness.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services