Skip to content

Commit

Permalink
Fix cold path cache hit panic (#11768)
Browse files Browse the repository at this point in the history
This is very difficult/impossible to test since it's reliant on specific
timing.
  • Loading branch information
samsondav committed Jan 12, 2024
1 parent 31565b6 commit c32efca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/services/relay/evm/mercury/wsrpc/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c32efca

Please sign in to comment.