From ed05a626f915cc5b89c5a615147aeb8a592d96cf Mon Sep 17 00:00:00 2001 From: Philippe Boneff Date: Fri, 23 Aug 2024 12:14:58 +0000 Subject: [PATCH] remove read mutex --- personalities/sctfe/storage.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/personalities/sctfe/storage.go b/personalities/sctfe/storage.go index 641c09ee..3605b3eb 100644 --- a/personalities/sctfe/storage.go +++ b/personalities/sctfe/storage.go @@ -95,7 +95,7 @@ func (cts *CTStorage) AddIssuerChain(ctx context.Context, chain []*x509.Certific // Only up to N keys will be stored locally. // TODO(phboneff): add monitoring for the number of keys type cachedIssuerStorage struct { - sync.RWMutex + sync.Mutex m map[string]struct{} N int // maximum number of entries allowed in m s IssuerStorage @@ -104,9 +104,7 @@ type cachedIssuerStorage struct { // Exists checks if the key exists in the local cache, if not checks in the underlying storage. // If it finds it there, caches the key locally. func (c *cachedIssuerStorage) Exists(ctx context.Context, key []byte) (bool, error) { - c.RLock() _, ok := c.m[string(key)] - c.RUnlock() if ok { klog.V(2).Infof("Exists: found %q in local key cache", key) return true, nil