adoroszlai commented on code in PR #3654:
URL: https://github.com/apache/ozone/pull/3654#discussion_r937448224


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/ChunkUtils.java:
##########
@@ -291,10 +301,18 @@ public static void verifyChunkFileExists(File file)
   }
 
   @VisibleForTesting
-  static <T> T processFileExclusively(Path path, Supplier<T> op) {
+  static <T> T processFileExclusively(Path path, Supplier<T> op)
+      throws InterruptedException {
+    long period = 1;
     for (;;) {
       if (LOCKS.add(path)) {
         break;
+      } else {
+        Thread.sleep(period);
+        // exponentially backoff until the sleep time is over 1 second.
+        if (period < 1000) {
+          period *= 2;

Review Comment:
   I don't think it's necessary.  `period` is not used after the lock is 
acquired.  Other callers will start from 1, since it's a local variable.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to