hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ji...@apache.org
Subject hadoop git commit: HDFS-10688. BPServiceActor may run into a tight loop for sending block report when hitting IOException. Contributed by Chen Liang.
Date Tue, 26 Jul 2016 01:43:36 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 26df6bd31 -> 30c772fc5


HDFS-10688. BPServiceActor may run into a tight loop for sending block report when hitting
IOException. Contributed by Chen Liang.

(cherry picked from commit 0cde9e12a7175e4d8bc4ccd5c36055b280d1fbd6)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/30c772fc
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/30c772fc
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/30c772fc

Branch: refs/heads/branch-2
Commit: 30c772fc595b71d3b26a13bd0473570a84b5e807
Parents: 26df6bd
Author: Jing Zhao <jing9@apache.org>
Authored: Mon Jul 25 18:41:13 2016 -0700
Committer: Jing Zhao <jing9@apache.org>
Committed: Mon Jul 25 18:43:25 2016 -0700

----------------------------------------------------------------------
 .../hdfs/server/datanode/BPServiceActor.java       | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/30c772fc/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
index 70004e0..24b1378 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
@@ -649,19 +649,24 @@ class BPServiceActor implements Runnable {
           return;
         }
         LOG.warn("RemoteException in offerService", re);
-        try {
-          long sleepTime = Math.min(1000, dnConf.heartBeatInterval);
-          Thread.sleep(sleepTime);
-        } catch (InterruptedException ie) {
-          Thread.currentThread().interrupt();
-        }
+        sleepAfterException();
       } catch (IOException e) {
         LOG.warn("IOException in offerService", e);
+        sleepAfterException();
       }
       processQueueMessages();
     } // while (shouldRun())
   } // offerService
 
+  private void sleepAfterException() {
+    try {
+      long sleepTime = Math.min(1000, dnConf.heartBeatInterval);
+      Thread.sleep(sleepTime);
+    } catch (InterruptedException ie) {
+      Thread.currentThread().interrupt();
+    }
+  }
+
   /**
    * Register one bp with the corresponding NameNode
    * <p>


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message