Copilot commented on code in PR #10214:
URL: https://github.com/apache/ozone/pull/10214#discussion_r3301673438


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerScanHelper.java:
##########
@@ -103,20 +111,37 @@ public void scanMetadata(Container<?> container)
       log.debug("Container [{}] has been deleted during metadata scan.", 
containerId);
       return;
     }
+
+    boolean isTransientFailure = 
ScanTransientIOUtil.scanErrorsAreOnlyTooManyOpenFiles(result);
+
     if (result.hasErrors()) {
-      handleUnhealthyScanResult(containerData, result);
+      handleUnhealthyScanResult(containerData, result, isTransientFailure);
     }
 
     Instant now = Instant.now();
     // Do not update the scan timestamp after the scan since this was just a
     // metadata scan, not a full data scan.
-    metrics.incNumContainersScanned();
-    // Even if the container was deleted, mark the scan as completed since we 
already logged it as starting.
-    logScanCompleted(containerData, now);
+    if (!isTransientFailure) {
+      metrics.incNumContainersScanned();
+      // Even if the container was deleted, mark the scan as completed since 
we already logged it as starting.

Review Comment:
   The inline comment about deleted containers is misleading here: 
`result.isDeleted()` returns earlier, so this block never runs for deleted 
containers. Either remove/update the comment to reflect the actual behavior (eg 
completion logging only happens for non-transient scans), or move the 
completion logging into the `isDeleted()` branch if you really want a 
completion log for deletions too.
   



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