keith-turner commented on code in PR #5728: URL: https://github.com/apache/accumulo/pull/5728#discussion_r2200940035
########## core/src/main/java/org/apache/accumulo/core/fate/ZooStore.java: ########## @@ -130,6 +136,31 @@ public long create() { } } + /* + * Holds a copy of all of the fate transaction in zookeeper. Used for finding the next one to + * reserve. When empty a single thread will refill. All fate threads can pull off of the queue as + * they look for something to reserve. This is used so that each thread does not have to read all + * children from zookeeper when looking for any fate tx to reserve. + */ + private final Queue<String> reservationCandidates = new ConcurrentLinkedQueue<>(); + private final Lock reservationCandidateLock = new ReentrantLock(); Review Comment: The existing code was reading the children outside of the lock, so I wanted to follow that pattern but still wanted a lock just to ensure that only one thread reads the list. I need to look at the locking in the entire class to see if this is warranted, made this locking decision based on only looking at what the existing function did. -- 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: notifications-unsubscr...@accumulo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org