Skip to content

Commit b84554a

Browse files
authored
HDDS-12331. BlockOutputStream.failedServers is not thread-safe (apache#7885)
1 parent 11318ee commit b84554a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import java.util.List;
3434
import java.util.concurrent.CompletableFuture;
3535
import java.util.concurrent.CompletionException;
36+
import java.util.concurrent.CopyOnWriteArrayList;
3637
import java.util.concurrent.ExecutionException;
3738
import java.util.concurrent.ExecutorService;
3839
import java.util.concurrent.atomic.AtomicBoolean;
@@ -228,7 +229,7 @@ public BlockOutputStream(
228229
totalWriteChunkLength = 0;
229230
totalPutBlockLength = 0;
230231
writtenDataLength = 0;
231-
failedServers = new ArrayList<>(0);
232+
failedServers = new CopyOnWriteArrayList<>();
232233
ioException = new AtomicReference<>(null);
233234
this.checksum = new Checksum(config.getChecksumType(), config.getBytesPerChecksum(), true);
234235
this.clientMetrics = clientMetrics;

0 commit comments

Comments
 (0)