From 61cee3a0b9a8ea2e4f6257c17c2d90c7c930cc34 Mon Sep 17 00:00:00 2001 From: Lei Xu Date: Thu, 14 Sep 2017 17:02:48 -0700 Subject: [PATCH] HDFS-12378. TestClientProtocolForPipelineRecovery#testZeroByteBlockRecovery fails on trunk. (Lei (Eddy) Xu) --- .../apache/hadoop/hdfs/server/datanode/DataNode.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 837ac078e8..042a6272d4 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 @@ -3000,8 +3000,16 @@ void transferReplicaForPipelineRecovery(final ExtendedBlock b, b.setNumBytes(visible); if (targets.length > 0) { - new Daemon(new DataTransfer(targets, targetStorageTypes, - targetStorageIds, b, stage, client)).start(); + Daemon daemon = new Daemon(threadGroup, + new DataTransfer(targets, targetStorageTypes, targetStorageIds, b, + stage, client)); + daemon.start(); + try { + daemon.join(); + } catch (InterruptedException e) { + throw new IOException( + "Pipeline recovery for " + b + " is interrupted.", e); + } } }