From 4629bbffb37dec7f4538f2d1dd419a08c4e1b19c Mon Sep 17 00:00:00 2001 From: Todd Lipcon Date: Fri, 26 Aug 2011 06:45:26 +0000 Subject: [PATCH] HDFS-2286. DataXceiverServer logs AsynchronousCloseException at shutdown. Contributed by Todd Lipcon. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1162004 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hadoop/hdfs/server/datanode/DataXceiverServer.java | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 927975c4b56..81e84f05351 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -992,6 +992,9 @@ Release 0.23.0 - Unreleased HDFS-1480. All replicas of a block can end up on the same rack when some datanodes are decommissioning. (todd) + HDFS-2286. DataXceiverServer logs AsynchronousCloseException at shutdown + (todd) + BREAKDOWN OF HDFS-1073 SUBTASKS HDFS-1521. Persist transaction ID on disk between NN restarts. diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java index 32902b7d102..89928a29719 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java @@ -21,6 +21,7 @@ import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; import java.net.SocketTimeoutException; +import java.nio.channels.AsynchronousCloseException; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; @@ -144,6 +145,12 @@ class DataXceiverServer implements Runnable { new Daemon(datanode.threadGroup, exciver).start(); } catch (SocketTimeoutException ignored) { // wake up to see if should continue to run + } catch (AsynchronousCloseException ace) { + // another thread closed our listener socket - that's expected during shutdown, + // but not in other circumstances + if (datanode.shouldRun) { + LOG.warn(datanode.getMachineName() + ":DataXceiverServer: ", ace); + } } catch (IOException ie) { LOG.warn(datanode.getMachineName() + ":DataXceiverServer: ", ie); } catch (Throwable te) {