From 0690f0969efef201b074a8b26400b2e5ba9b97ad Mon Sep 17 00:00:00 2001 From: Xiao Chen Date: Thu, 1 Sep 2016 15:34:47 -0700 Subject: [PATCH] HDFS-10820. Reuse closeResponder to reset the response variable in DataStreamer#run. Contributed by Yiqun Lin. --- .../main/java/org/apache/hadoop/hdfs/DataStreamer.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java index ee673ed68b4..062a4160954 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java @@ -536,14 +536,8 @@ class DataStreamer extends Daemon { TraceScope scope = null; while (!streamerClosed && dfsClient.clientRunning) { // if the Responder encountered an error, shutdown Responder - if (errorState.hasError() && response != null) { - try { - response.close(); - response.join(); - response = null; - } catch (InterruptedException e) { - LOG.warn("Caught exception", e); - } + if (errorState.hasError()) { + closeResponder(); } DFSPacket one;