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 837ac078e8b..042a6272d49 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 @@ public class DataNode extends ReconfigurableBase 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); + } } }