Skip to content

Commit

Permalink
[FLINK-33201][Connectors/Kafka] Fix memory leak in CachingTopicSelector
Browse files Browse the repository at this point in the history
  • Loading branch information
qbx2 authored and AHeise committed Aug 22, 2024
1 parent b5b8076 commit ea3a641
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ private static class CachingTopicSelector<IN> implements Function<IN, String>, S
public String apply(IN in) {
final String topic = cache.getOrDefault(in, topicSelector.apply(in));
cache.put(in, topic);
if (cache.size() == CACHE_RESET_SIZE) {
if (cache.size() >= CACHE_RESET_SIZE) {
cache.clear();
}
return topic;
Expand Down

0 comments on commit ea3a641

Please sign in to comment.