ddanielr commented on code in PR #6166:
URL: https://github.com/apache/accumulo/pull/6166#discussion_r2881376838


##########
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:
   nope, I had used this for some of my test debugging and it can go away.
   
   The null checks are a pre-optimization as well in preparation for future 
refactoring. The current code shouldn't allow null objects to be passed in. I 
can also pull those out as well if desired. 



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

Reply via email to