rsrkpatwari1234 commented on code in PR #17523:
URL: https://github.com/apache/pinot/pull/17523#discussion_r2778958801


##########
pinot-common/src/main/java/org/apache/pinot/common/utils/fetcher/BaseSegmentFetcher.java:
##########
@@ -151,4 +163,19 @@ protected void fetchSegmentToLocalWithoutRetry(URI uri, 
File dest)
       throws Exception {
     throw new UnsupportedOperationException();
   }
+
+  /**
+   * Checks if the exception or its cause chain contains a 
FileNotFoundException.
+   * FileNotFoundException indicates the file doesn't exist and retrying won't 
help.
+   */
+  private boolean isFileNotFoundException(Exception e) {
+    Throwable cause = e;
+    while (cause != null) {
+      if (cause instanceof java.io.FileNotFoundException) {
+        return true;
+      }
+      cause = cause.getCause();

Review Comment:
   Modified the code to avoid redundancy but the loop is safe as longer cycles 
don’t occur in normal exception cause chains 



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