Skip to content

Commit aebc234

Browse files
committed
[hotfix] Fix FlinkKafkaConsumerBaseTest.testClosePartitionDiscovererWithCancellation
Make a copy of AbstractPartitionDiscoverer#getAllTopics before modifying it.
1 parent 2d287d1 commit aebc234

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/AbstractPartitionDiscoverer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import org.apache.flink.annotation.Internal;
2121

22+
import java.util.ArrayList;
2223
import java.util.HashSet;
2324
import java.util.Iterator;
2425
import java.util.List;
@@ -132,7 +133,7 @@ public List<KafkaTopicPartition> discoverPartitions() throws WakeupException, Cl
132133
newDiscoveredPartitions =
133134
getAllPartitionsForTopics(topicsDescriptor.getFixedTopics());
134135
} else {
135-
List<String> matchedTopics = getAllTopics();
136+
List<String> matchedTopics = new ArrayList<>(getAllTopics());
136137

137138
// retain topics that match the pattern
138139
Iterator<String> iter = matchedTopics.iterator();

0 commit comments

Comments
 (0)