Repository: hadoop Updated Branches: refs/heads/trunk 4aa9b3e75 -> c11fc8a1b
HDFS-9181. Better handling of exceptions thrown during upgrade shutdown. Contributed by Wei-Chiu Chuang. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/c11fc8a1 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/c11fc8a1 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/c11fc8a1 Branch: refs/heads/trunk Commit: c11fc8a1be222f870cded0b24736387e44cc788c Parents: 4aa9b3e Author: Yongjun Zhang <[email protected]> Authored: Fri Oct 9 09:21:29 2015 -0700 Committer: Yongjun Zhang <[email protected]> Committed: Fri Oct 9 09:21:29 2015 -0700 ---------------------------------------------------------------------- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../org/apache/hadoop/hdfs/server/datanode/DataNode.java | 3 ++- .../apache/hadoop/hdfs/server/datanode/TestDataNodeExit.java | 8 ++++---- 3 files changed, 9 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/c11fc8a1/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 6e6ca96..7dbdfa8 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 http://git-wip-us.apache.org/repos/asf/hadoop/blob/c11fc8a1/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java ---------------------------------------------------------------------- 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 b280067..c4c5bbb 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 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); } } http://git-wip-us.apache.org/repos/asf/hadoop/blob/c11fc8a1/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeExit.java ---------------------------------------------------------------------- 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 da98d26..7a15b85 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); } } }
