Skip to content

Commit e111789

Browse files
ChenSamminandakumar131
authored andcommitted
HDDS-1882. TestReplicationManager failed with NPE. (#1197)
1 parent a7371a7 commit e111789

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,11 @@ private void handleUnderReplicatedContainer(final ContainerInfo container,
486486
final List<DatanodeDetails> excludeList = replicas.stream()
487487
.map(ContainerReplica::getDatanodeDetails)
488488
.collect(Collectors.toList());
489-
inflightReplication.get(id).stream().map(r -> r.datanode)
490-
.forEach(excludeList::add);
489+
List<InflightAction> actionList = inflightReplication.get(id);
490+
if (actionList != null) {
491+
actionList.stream().map(r -> r.datanode)
492+
.forEach(excludeList::add);
493+
}
491494
final List<DatanodeDetails> selectedDatanodes = containerPlacement
492495
.chooseDatanodes(excludeList, null, delta,
493496
container.getUsedBytes());

0 commit comments

Comments
 (0)