milleruntime commented on a change in pull request #2329:
URL: https://github.com/apache/accumulo/pull/2329#discussion_r791869863



##########
File path: 
core/src/main/java/org/apache/accumulo/fate/zookeeper/DistributedReadWriteLock.java
##########
@@ -218,22 +229,68 @@ public boolean tryLock() {
       }
       SortedMap<Long,byte[]> entries = qlock.getEarlierEntries(entry);
       Iterator<Entry<Long,byte[]>> iterator = entries.entrySet().iterator();
-      if (!iterator.hasNext())
+      if (!iterator.hasNext()) {
         throw new IllegalStateException("Did not find our own lock in the 
queue: " + this.entry
             + " userData " + new String(this.userData, UTF_8) + " lockType " + 
lockType());
-      return iterator.next().getKey().equals(entry);
+      }
+      if (iterator.next().getKey().equals(entry)) {
+        return true;
+      }
+      if (preemptBlockingTransactions) {
+        log.info("Preempting transactions that are blocking this transaction");

Review comment:
       In other parts of the code you call this boolean 
`cancelWriteLockBlockers`. I think picking one consistent name would be better. 
I like `cancelWriteLockBlockers` better than `preemptBlockingTransactions`. I 
have a PR against your branch with some minor changes that includes this rename.




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