Skip to content

Commit

Permalink
Use ConcurrentHashMap in IngressProducerReconcilableStore to avoid Co…
Browse files Browse the repository at this point in the history
…ncurrentModificationException (#3876)

Co-authored-by: Christoph Stäbler <cstabler@redhat.com>
  • Loading branch information
knative-prow-robot and creydr committed May 3, 2024
1 parent 99cf1ab commit 1495831
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -30,10 +30,10 @@
import io.cloudevents.jackson.JsonFormat;
import io.cloudevents.kafka.CloudEventSerializer;
import io.vertx.core.Future;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.slf4j.Logger;
Expand Down Expand Up @@ -76,10 +76,10 @@ public IngressProducerReconcilableStore(
this.producerConfigs = producerConfigs;
this.producerFactory = producerFactory;

this.ingressInfos = new HashMap<>();
this.producerReferences = new HashMap<>();
this.pathMapper = new HashMap<>();
this.hostMapper = new HashMap<>();
this.ingressInfos = new ConcurrentHashMap<>();
this.producerReferences = new ConcurrentHashMap<>();
this.pathMapper = new ConcurrentHashMap<>();
this.hostMapper = new ConcurrentHashMap<>();
}

public IngressProducer resolve(String host, String path) {
Expand Down

0 comments on commit 1495831

Please sign in to comment.