keith-turner commented on code in PR #6166:
URL: https://github.com/apache/accumulo/pull/6166#discussion_r2881179275
##########
core/src/main/java/org/apache/accumulo/core/fate/zookeeper/ServiceLock.java:
##########
@@ -825,13 +825,24 @@ public static void deleteLock(ZooReaderWriter zk,
ServiceLockPath path)
public static void deleteLock(ZooReaderWriter zoo, String path,
ServerServices.Service serviceType, Predicate<HostAndPort>
hostPortPredicate,
Consumer<String> messageOutput, Boolean dryRun) throws KeeperException,
InterruptedException {
+
+ Objects.requireNonNull(path, "Lock path cannot be null");
+ Objects.requireNonNull(hostPortPredicate, "host predicate cannot be null");
+
+ if (!zoo.exists(path)) {
+ throw new IllegalStateException("Path " + path + " does not exist");
+ }
Review Comment:
This exists check may not be needed. Seems like `ServiceLock.getLockData()`
may call `Zookeeper.getChildren()` on the path and that may throw
NoNodeException if it does not exists. Was a specific exception type needed?
--
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]