From c32efca111a53c3c1129260a4501b4cd404c888b Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 12 Jan 2024 15:03:46 -0500 Subject: [PATCH] Fix cold path cache hit panic (#11768) This is very difficult/impossible to test since it's reliant on specific timing. --- core/services/relay/evm/mercury/wsrpc/cache/cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/services/relay/evm/mercury/wsrpc/cache/cache.go b/core/services/relay/evm/mercury/wsrpc/cache/cache.go index 181900bc15c..712e62e5c0e 100644 --- a/core/services/relay/evm/mercury/wsrpc/cache/cache.go +++ b/core/services/relay/evm/mercury/wsrpc/cache/cache.go @@ -237,7 +237,7 @@ func (m *memCache) LatestReport(ctx context.Context, req *pb.LatestReportRequest // CACHE HIT promCacheHitCount.WithLabelValues(m.client.ServerURL(), feedIDHex).Inc() m.lggr.Tracew("LatestReport CACHE HIT (cold path)", "feedID", feedIDHex) - defer v.RUnlock() + defer v.Unlock() return v.val, nil } else if v.fetching { // CACHE WAIT