diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 6e6ca96f8b..7dbdfa85cd 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1500,6 +1500,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 b2800678a7..c4c5bbb7a9 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 @@ -1743,8 +1743,9 @@ public void shutdown() { 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 da98d26cd5..7a15b8556d 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 void testBPServiceExit() throws Exception { 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); } } }