[ 
https://issues.apache.org/jira/browse/HDDS-1205?focusedWorklogId=216532&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-216532
 ]

ASF GitHub Bot logged work on HDDS-1205:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/Mar/19 23:36
            Start Date: 20/Mar/19 23:36
    Worklog Time Spent: 10m 
      Work Description: arp7 commented on pull request #620: HDDS-1205. 
Refactor ReplicationManager to handle QUASI_CLOSED contain…
URL: https://github.com/apache/hadoop/pull/620#discussion_r267587317
 
 

 ##########
 File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java
 ##########
 @@ -192,24 +193,19 @@ public void stop() {
    * ReplicationMonitor thread runnable. This wakes up at configured
    * interval and processes all the containers in the system.
    */
-  private void run() {
+  private synchronized void run() {
     try {
       while (running) {
-        try {
-          final long start = Time.monotonicNow();
-          final Set<ContainerID> containerIds =
-              containerManager.getContainerIDs();
-          containerIds.forEach(this::processContainer);
-          LOG.info("Replication Monitor Thread took {} milliseconds for" +
-                  " processing {} containers.", Time.monotonicNow() - start,
-              containerIds.size());
-          if (!Thread.interrupted()) {
-            Thread.sleep(interval);
-          }
-        } catch (InterruptedException ex) {
-          // Wakeup and process the containers.
-          LOG.debug("Replication Monitor Thread got interrupted.");
-        }
+        final long start = Time.monotonicNow();
+        final Set<ContainerID> containerIds =
+            containerManager.getContainerIDs();
+        containerIds.forEach(this::processContainer);
+
+        LOG.info("Replication Monitor Thread took {} milliseconds for" +
+                " processing {} containers.", Time.monotonicNow() - start,
+            containerIds.size());
+
+        wait(interval);
       }
     } catch (Throwable t) {
       // When we get runtime exception, we should terminate SCM.
 
 Review comment:
   Don't call terminate if running is false. In that case, just exit the 
thread. See RedundancyMonitor#run in HDFS BlockManager.java.
 
----------------------------------------------------------------
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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 216532)
    Time Spent: 5h 40m  (was: 5.5h)

> Refactor ReplicationManager to handle QUASI_CLOSED containers
> -------------------------------------------------------------
>
>                 Key: HDDS-1205
>                 URL: https://issues.apache.org/jira/browse/HDDS-1205
>             Project: Hadoop Distributed Data Store
>          Issue Type: Improvement
>          Components: SCM
>            Reporter: Nanda kumar
>            Assignee: Nanda kumar
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HDDS-1205.000.patch, HDDS-1205.001.patch, 
> HDDS-1205.002.patch
>
>          Time Spent: 5h 40m
>  Remaining Estimate: 0h
>
> This Jira is for refactoring the ReplicationManager code to handle all the 
> scenarios that are possible with the introduction of QUASI_CLOSED state of a 
> container.
> The new ReplicationManager will go through the complete set of containers in 
> SCM to find out under/over replicated and unhealthy containers and takes 
> appropriate action.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to