ashishkumar50 commented on code in PR #9973:
URL: https://github.com/apache/ozone/pull/9973#discussion_r3007526687


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/utils/DiskCheckUtil.java:
##########
@@ -173,9 +182,19 @@ public boolean checkReadWrite(File storageDir,
             "for volume check.", testFile.getAbsolutePath()), notFoundEx);
         return false;
       } catch (IOException ioEx) {
+        String ioem = ioEx.getMessage();
+        String causeMsg = ioEx.getCause() != null ? 
ioEx.getCause().getMessage() : null;
+        causeMsg = causeMsg != null ? causeMsg : "";
+        if ((ioem != null && ioem.contains(TOO_MANY_OPEN_FILES)) || 
causeMsg.contains(TOO_MANY_OPEN_FILES)) {
+          LOG.warn("Could not read file {} for volume check.", 
testFile.getAbsolutePath(), ioEx);
+          return true;
+        }
         logError(storageDir, String.format("Could not read file %s " +
             "for volume check.", testFile.getAbsolutePath()), ioEx);
         return false;
+      } catch (Throwable t) {
+        logError(storageDir, String.format("Could not read file %s " +
+            "for volume check.", testFile.getAbsolutePath()), t);

Review Comment:
   We can return `false` here.



##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/utils/DiskCheckUtil.java:
##########
@@ -173,9 +182,19 @@ public boolean checkReadWrite(File storageDir,
             "for volume check.", testFile.getAbsolutePath()), notFoundEx);
         return false;
       } catch (IOException ioEx) {
+        String ioem = ioEx.getMessage();
+        String causeMsg = ioEx.getCause() != null ? 
ioEx.getCause().getMessage() : null;
+        causeMsg = causeMsg != null ? causeMsg : "";
+        if ((ioem != null && ioem.contains(TOO_MANY_OPEN_FILES)) || 
causeMsg.contains(TOO_MANY_OPEN_FILES)) {
+          LOG.warn("Could not read file {} for volume check.", 
testFile.getAbsolutePath(), ioEx);
+          return true;

Review Comment:
   We should try to delete file or else orphan file will keep increasing here.



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