From 284dd7bed4934018e613baa8d25a12960669c408 Mon Sep 17 00:00:00 2001 From: Neeharika Sompalli <52669918+Neeharika-Sompalli@users.noreply.github.com> Date: Sat, 13 Jan 2024 20:18:38 -0600 Subject: [PATCH] fix: (mod-service)Use concurrent read cache (#10965) Signed-off-by: Michael Tinker Co-authored-by: Michael Tinker --- .../java/com/hedera/node/app/spi/state/ReadableKVStateBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hedera-node/hedera-app-spi/src/main/java/com/hedera/node/app/spi/state/ReadableKVStateBase.java b/hedera-node/hedera-app-spi/src/main/java/com/hedera/node/app/spi/state/ReadableKVStateBase.java index 4d5548365ae4..a5619ad5dd31 100644 --- a/hedera-node/hedera-app-spi/src/main/java/com/hedera/node/app/spi/state/ReadableKVStateBase.java +++ b/hedera-node/hedera-app-spi/src/main/java/com/hedera/node/app/spi/state/ReadableKVStateBase.java @@ -38,7 +38,7 @@ public abstract class ReadableKVStateBase implements ReadableKVState * changed before we got to handle transaction. If the value is "null", this means it was NOT * FOUND when we looked it up. */ - private final Map readCache = new HashMap<>(); + private final Map readCache = Collections.synchronizedMap(new HashMap<>()); private final Set unmodifiableReadKeys = Collections.unmodifiableSet(readCache.keySet());