keith-turner commented on code in PR #4785:
URL: https://github.com/apache/accumulo/pull/4785#discussion_r1702334311


##########
core/src/main/java/org/apache/accumulo/core/fate/ZooStore.java:
##########
@@ -164,8 +164,10 @@ public long reserve() {
             }
 
             if (deferred.containsKey(tid)) {
-              if (deferred.get(tid).elapsed().compareTo(Duration.ZERO) > 0) {
-                deferred.remove(tid);
+              long deferredTime = deferred.get(tid);
+              long currentTime = System.nanoTime();
+              if (currentTime >= deferredTime) {

Review Comment:
   Its not correct to directly compare two nanoTimes.  This is one of the 
reasons the nano time class was created, to ensure the comparisons were always 
done correctly.   The other purpose of the class was to ensure unit conversions 
were correct ensuring nanos were not compared to millis for example.  Why not 
use the new class here?
   
   Think this should be the following to be correct.
   
   ```suggestion
                 if ((currentTime - deferredTime) >= 0) {
   ```
   



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