Copilot commented on code in PR #10214:
URL: https://github.com/apache/ozone/pull/10214#discussion_r3271120276
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerScanHelper.java:
##########
@@ -115,8 +115,17 @@ public void scanMetadata(Container<?> container)
logScanCompleted(containerData, now);
}
+ /**
+ * Marks container UNHEALTHY when the scan reports real errors.
+ * If every scan error is related to file-descriptor exhaustion, return
without marking container unhealthy.
+ */
public void handleUnhealthyScanResult(ContainerData containerData,
ScanResult result) throws IOException {
long containerID = containerData.getContainerID();
+ if (ScanTransientIOUtil.scanErrorsAreOnlyTooManyOpenFiles(result)) {
+ log.warn("Skipped marking container UNHEALTHY [{}]: scan failed due to
transient " +
+ "file descriptor exhaustion ('Too many open files'). {}",
containerID, result);
+ return;
+ }
Review Comment:
`handleUnhealthyScanResult` now returns early for FD-exhaustion, but callers
(eg `scanData`) will still treat the scan as completed: it increments
`incNumContainersScanned()`, updates the data-scan timestamp, and (for data
scans) updates the container checksum before this method is called. That can
delay the next rescan even though the scan was incomplete, and may persist a
checksum derived from a partial scan.
Consider propagating a “transient failure / scan not completed” signal (eg
return boolean/enum or throw a specific exception) so `scanData`/`scanMetadata`
can skip timestamp/checksum updates and scanned metrics when the scan failed
due to "Too many open files".
--
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]