From 4ab0c8f96a41c573cc1f1e71c18871d243f952b9 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. --- .../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 386ba277ef4..8b0f0947f9e 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 @@ -3889,11 +3889,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); + } } }