You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2021/01/29 15:57:38 UTC
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1890: Check if ZK node exists before doing work
ctubbsii commented on a change in pull request #1890:
URL: https://github.com/apache/accumulo/pull/1890#discussion_r566920399
##########
File path: server/base/src/main/java/org/apache/accumulo/server/zookeeper/TransactionWatcher.java
##########
@@ -104,13 +104,15 @@ public static void cleanup(ServerContext context, String type, long tid)
final ZooReader reader = context.getZooReaderWriter();
final Set<Long> result = new HashSet<>();
final String parent = context.getZooKeeperRoot() + "/" + type;
- reader.sync(parent);
- List<String> children = reader.getChildren(parent);
- for (String child : children) {
- if (child.endsWith("-running")) {
- continue;
+ if (reader.exists(parent)) {
Review comment:
Is it okay to return an empty set if the parent doesn't exist? I'm not sure what the undocumented return value of this method is supposed to represent, so it's not easy to tell if returning an empty set is okay in this case.
----------------------------------------------------------------
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:
users@infra.apache.org