dlmarion commented on code in PR #5145:
URL: https://github.com/apache/accumulo/pull/5145#discussion_r1873793339
##########
core/src/main/java/org/apache/accumulo/core/fate/zookeeper/ServiceLock.java:
##########
@@ -762,4 +762,26 @@ public static boolean deleteLock(ZooReaderWriter zk,
ServiceLockPath path, Strin
return false;
}
+
+ /**
+ * Checks that the lock still exists in ZooKeeper. The typical mechanism for
determining if a lock
+ * is lost depends on a Watcher set on the lock node. There exists a case
where the Watcher may
+ * not get called if another Watcher is stuck waiting on I/O or otherwise
hung. In the case where
+ * this method returns false, then the typical action is to exit the server
process.
+ *
+ * @return true if lock path still exists, false otherwise and on error
+ */
+ public boolean verifyLockAtSource() {
+ if (getLockPath() == null) {
Review Comment:
I partially implemented this in 601aff5. I did not add the preconditions
check as then I would need to handle an IllegalStateException in the
verification thread and any place that this is called in the future. I think
checking that the lockPath is null is sufficient.
--
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]