Skip to content

Commit d203045

Browse files
paulward24anuengineer
authored andcommitted
HDFS-14618. Incorrect synchronization of ArrayList field (ArrayList is thread-unsafe). Contributed by Paul Ward.
1 parent da56899 commit d203045

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/PendingReconstructionBlocks.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ void remove(BlockInfo block) {
132132
public void clear() {
133133
synchronized (pendingReconstructions) {
134134
pendingReconstructions.clear();
135-
timedOutItems.clear();
135+
synchronized (timedOutItems) {
136+
timedOutItems.clear();
137+
}
136138
timedOutCount = 0L;
137139
}
138140
}

0 commit comments

Comments
 (0)