From 3ed7a2ca422d3007e5bfa67fd5790c2f06c23959 Mon Sep 17 00:00:00 2001 From: Wei-Chiu Chuang Date: Thu, 19 Oct 2017 06:17:59 -0700 Subject: [PATCH] HDFS-12619. Do not catch and throw unchecked exceptions if IBRs fail to process. Contributed by Wei-Chiu Chuang. (cherry picked from commit 4ab0c8f96a41c573cc1f1e71c18871d243f952b9) --- .../hdfs/server/blockmanagement/BlockManager.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java index 4f0ec43e231..a49cb248a23 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java @@ -3443,11 +3443,15 @@ public class BlockManager implements BlockStatsMXBean { throw new IOException( "Got incremental block report from unregistered or dead node"); } + + boolean successful = false; try { processIncrementalBlockReport(node, srdb); - } catch (Exception ex) { - node.setForceRegistration(true); - throw ex; + successful = true; + } finally { + if (!successful) { + node.setForceRegistration(true); + } } }