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


##########
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:
   Should we reset the period when the lock is acquired?



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