bharatviswa504 commented on a change in pull request #788: HDDS-1475 : Fix 
OzoneContainer start method.
URL: https://github.com/apache/hadoop/pull/788#discussion_r281770846
 
 

 ##########
 File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/OzoneContainer.java
 ##########
 @@ -160,8 +160,12 @@ private void startContainerScrub() {
       LOG.info("Background container scrubber has been disabled by {}",
               HddsConfigKeys.HDDS_CONTAINERSCRUB_ENABLED);
     } else {
-      this.scrubber = new ContainerScrubber(containerSet, config);
-      scrubber.up();
+      if (this.scrubber == null) {
+        this.scrubber = new ContainerScrubber(containerSet, config);
+      }
+      if (this.scrubber.isHalted()) {
 
 Review comment:
   I think we don't need this check here, as scrubber up() is already taking 
care of multiple starts.
   public void up() {
   
       this.halt = false;
       if (this.scrubThread == null) {
         this.scrubThread = new Thread(this);
         scrubThread.start();
       } else {
         LOG.info("Scrubber up called multiple times. Scrub thread already 
up.");
       }
     }

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to