arp7 commented on a change in pull request #620: HDDS-1205. Refactor 
ReplicationManager to handle QUASI_CLOSED contain…
URL: https://github.com/apache/hadoop/pull/620#discussion_r267171595
 
 

 ##########
 File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java
 ##########
 @@ -186,16 +197,18 @@ private void run() {
       while (running) {
         try {
           final long start = Time.monotonicNow();
-          final List<ContainerID> containerIds =
+          final Set<ContainerID> containerIds =
               containerManager.getContainerIDs();
-          containerIds.parallelStream().forEach(this::processContainer);
-          LOG.debug("Replication Monitor Thread took {} milliseconds for" +
+          containerIds.forEach(this::processContainer);
+          LOG.info("Replication Monitor Thread took {} milliseconds for" +
                   " processing {} containers.", Time.monotonicNow() - start,
               containerIds.size());
-          Thread.sleep(interval);
+          if (!Thread.interrupted()) {
+            Thread.sleep(interval);
+          }
         } catch (InterruptedException ex) {
           // Wakeup and process the containers.
-          LOG.debug("Replication Monitor Thread got interrupt exception.");
+          LOG.debug("Replication Monitor Thread got interrupted.");
 
 Review comment:
   Sorry I missed this earlier. We should call 
Thread.getCurrentThread().interrupt() here. https://stackoverflow.com/a/4906814 

----------------------------------------------------------------
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: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to