Skip to content

Commit

Permalink
Use ConcurrentHashMap in IngressProducerReconcilableStore to avoid Co…
Browse files Browse the repository at this point in the history
…ncurrentModificationException (knative-extensions#3875) (#1074)
  • Loading branch information
creydr authored May 3, 2024
1 parent b6ee2d1 commit 7989c29
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
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 7989c29

Please sign in to comment.