This is an automated email from the ASF dual-hosted git repository.

szetszwo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new c251258832 HDDS-6658. BackgroundPipelineCreator does not always stop 
quickly (#3357)
c251258832 is described below

commit c2512588322677afcb0118c9ccb0057f01b877b3
Author: Stephen O'Donnell <[email protected]>
AuthorDate: Thu Apr 28 15:58:25 2022 +0100

    HDDS-6658. BackgroundPipelineCreator does not always stop quickly (#3357)
---
 .../apache/hadoop/hdds/scm/pipeline/BackgroundPipelineCreator.java   | 5 ++---
 .../apache/hadoop/hdds/scm/pipeline/BackgroundPipelineScrubber.java  | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git 
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/BackgroundPipelineCreator.java
 
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/BackgroundPipelineCreator.java
index c9eb68346f..006453fad3 100644
--- 
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/BackgroundPipelineCreator.java
+++ 
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/BackgroundPipelineCreator.java
@@ -148,9 +148,7 @@ public class BackgroundPipelineCreator implements 
SCMService {
     LOG.info("Stopping {}.", THREAD_NAME);
 
     // in case RatisPipelineUtilsThread is sleeping
-    synchronized (monitor) {
-      monitor.notifyAll();
-    }
+    thread.interrupt();
 
     try {
       thread.join();
@@ -175,6 +173,7 @@ public class BackgroundPipelineCreator implements 
SCMService {
         }
       } catch (InterruptedException e) {
         LOG.warn("{} is interrupted.", THREAD_NAME);
+        running.set(false);
         Thread.currentThread().interrupt();
       }
     }
diff --git 
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/BackgroundPipelineScrubber.java
 
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/BackgroundPipelineScrubber.java
index be465f6321..29fbd00d7c 100644
--- 
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/BackgroundPipelineScrubber.java
+++ 
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/BackgroundPipelineScrubber.java
@@ -136,7 +136,7 @@ public class BackgroundPipelineScrubber implements 
SCMService {
         LOG.info("Pipeline Scrubber Service is not running, skip stop.");
         return;
       }
-      notifyAll();
+      scrubThread.interrupt();
     }
     LOG.info("Stopping Pipeline Scrubber Service.");
   }


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

Reply via email to