ChenSammi commented on code in PR #9954:
URL: https://github.com/apache/ozone/pull/9954#discussion_r2981029167


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/StorageVolume.java:
##########
@@ -753,6 +754,52 @@ public synchronized VolumeCheckResult check(@Nullable 
Boolean unused)
     return VolumeCheckResult.HEALTHY;
   }
 
+  /**
+   * Called by {@link StorageVolumeChecker} when {@code checkAllVolumes()}
+   * latch times out and this volume has not yet reported a result.
+   *
+   * <p>Increments the consecutive latch-timeout counter. Returns {@code true}
+   * if the counter now exceeds the configured tolerance, meaning the volume
+   * should be added to the failed set. Returns {@code false} if the timeout
+   * is still within tolerance and the volume should be spared this round.
+   *
+   * @return true if the volume should be considered FAILED; false otherwise.
+   */
+  public synchronized boolean recordCheckTimeout() {

Review Comment:
   Instead of introducing new consecutiveTimeoutCount threashold, can we reuse 
the same ioFailureTolerance, similar to these logic in check()? 
   
   ```
    ioTestSlidingWindow.add(diskChecksPassed);
       if (!diskChecksPassed) {
         currentIOFailureCount.incrementAndGet();
       }
       if (ioTestSlidingWindow.size() > ioTestCount &&
           Objects.equals(ioTestSlidingWindow.poll(), Boolean.FALSE)) {
         currentIOFailureCount.decrementAndGet();
       }
   
     if (currentIOFailureCount.get() > ioFailureTolerance) {
         LOG.error("Failed IO test for volume {}: the last {} runs " +
                 "encountered {} out of {} tolerated failures.", this,
             ioTestSlidingWindow.size(), currentIOFailureCount,
             ioFailureTolerance);
         return VolumeCheckResult.FAILED;
   ```



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