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


##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/ExtendedInputStream.java:
##########
@@ -101,4 +106,14 @@ public boolean hasCapability(String capability) {
       return false;
     }
   }
+
+  public static void setRetryPolicy(OzoneClientConfig config) {
+    retryPolicy =
+        HddsClientUtils.createRetryPolicy(config.getMaxReadRetryCount(),
+            TimeUnit.SECONDS.toMillis(config.getReadRetryInterval()));

Review Comment:
   Storing this as `static` seems unsafe.
   
   1. Code is spread in 3 places:
   - this class
   - class that calls `setRetryPolicy`
   - class that uses the policy
   It is hard to see if any usage may get outdated or `null` value.
   
   2. Concurrent clients may get unexpected results.



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