xiaoyuyao commented on a change in pull request #286: HDDS-2475. Unregister 
ContainerMetadataScrubberMetrics on thread exit
URL: https://github.com/apache/hadoop-ozone/pull/286#discussion_r353366254
 
 

 ##########
 File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerMetadataScanner.java
 ##########
 @@ -58,11 +58,17 @@ public void run() {
      * the outer daemon loop exits on shutdown()
      */
     LOG.info("Background ContainerMetadataScanner starting up");
-    while (!stopping) {
-      runIteration();
-      if(!stopping) {
-        metrics.resetNumUnhealthyContainers();
-        metrics.resetNumContainersScanned();
+    try {
+      while (!stopping) {
+        runIteration();
+        if (!stopping) {
+          metrics.resetNumUnhealthyContainers();
+          metrics.resetNumContainersScanned();
+        }
+      }
 
 Review comment:
   Can we add a log entry if any chance the runIteration() throw? Similar logic 
can be found in ContainerDataScanner#run().

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to