From b0eb3f23214de9be1ce612f0ece2cd75d8e2fdc4 Mon Sep 17 00:00:00 2001 From: Roman Lovakov Date: Fri, 13 Sep 2024 20:44:02 +0300 Subject: [PATCH] Fix ConcurrentModificationException in federation fetcher --- .../io/smallrye/graphql/bootstrap/FederationDataFetcher.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/implementation/src/main/java/io/smallrye/graphql/bootstrap/FederationDataFetcher.java b/server/implementation/src/main/java/io/smallrye/graphql/bootstrap/FederationDataFetcher.java index 43d14724a..312a90285 100644 --- a/server/implementation/src/main/java/io/smallrye/graphql/bootstrap/FederationDataFetcher.java +++ b/server/implementation/src/main/java/io/smallrye/graphql/bootstrap/FederationDataFetcher.java @@ -11,6 +11,7 @@ import java.util.Objects; import java.util.Set; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ConcurrentHashMap; import java.util.function.BiFunction; import java.util.function.Function; import java.util.stream.Collectors; @@ -39,7 +40,7 @@ public class FederationDataFetcher implements DataFetcher cache = new HashMap<>(); + private final ConcurrentHashMap cache = new ConcurrentHashMap<>(); public FederationDataFetcher(GraphQLObjectType queryType, GraphQLCodeRegistry codeRegistry) { this.queryType = queryType;