diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 97a50bcd778..290c5ef179a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -676,6 +676,9 @@ Release 2.8.0 - UNRELEASED HDFS-8164. cTime is 0 in VERSION file for newly formatted NameNode. (Xiao Chen via Yongjun Zhang) + HDFS-9181. Better handling of exceptions thrown during upgrade shutdown. + (Wei-Chiu Chuang via Yongjun Zhang) + OPTIMIZATIONS HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java index b9be20e2770..e0e8de5ff92 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java @@ -1765,8 +1765,9 @@ public class DataNode extends ReconfigurableBase xserver.sendOOBToPeers(); ((DataXceiverServer) this.dataXceiverServer.getRunnable()).kill(); this.dataXceiverServer.interrupt(); - } catch (Throwable e) { + } catch (Exception e) { // Ignore, since the out of band messaging is advisory. + LOG.trace("Exception interrupting DataXceiverServer: ", e); } } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeExit.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeExit.java index da98d26cd5f..7a15b8556dd 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeExit.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeExit.java @@ -96,13 +96,13 @@ public class TestDataNodeExit { public void testSendOOBToPeers() throws Exception { DataNode dn = cluster.getDataNodes().get(0); DataXceiverServer spyXserver = Mockito.spy(dn.getXferServer()); - NullPointerException e = new NullPointerException(); - Mockito.doThrow(e).when(spyXserver).sendOOBToPeers(); + NullPointerException npe = new NullPointerException(); + Mockito.doThrow(npe).when(spyXserver).sendOOBToPeers(); dn.xserver = spyXserver; try { dn.shutdown(); - } catch (Throwable t) { - fail("DataNode shutdown should not have thrown exception " + t); + } catch (Exception e) { + fail("DataNode shutdown should not have thrown exception " + e); } } }