From b6c06c4b76ca5c206639e2ddea4f3bef393dbb11 Mon Sep 17 00:00:00 2001 From: S O'Donnell Date: Fri, 9 Jul 2021 10:03:57 +0100 Subject: [PATCH] HDFS-15796. ConcurrentModificationException error happens on NameNode occasionally. Contributed by Daniel Ma --- .../server/blockmanagement/PendingReconstructionBlocks.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/PendingReconstructionBlocks.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/PendingReconstructionBlocks.java index acf0598639..81495ebaf2 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/PendingReconstructionBlocks.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/PendingReconstructionBlocks.java @@ -333,7 +333,7 @@ List getTargets(BlockInfo block) { synchronized (pendingReconstructions) { PendingBlockInfo found = pendingReconstructions.get(block); if (found != null) { - return found.targets; + return new ArrayList<>(found.targets); } } return null;