diff --git a/authorize/authorize.go b/authorize/authorize.go index 01960792f..a25da96fe 100644 --- a/authorize/authorize.go +++ b/authorize/authorize.go @@ -6,7 +6,6 @@ import ( "context" "fmt" "slices" - "sync" "time" "github.com/rs/zerolog" @@ -35,11 +34,6 @@ type Authorize struct { globalCache storage.Cache groupsCacheWarmer *cacheWarmer - // The stateLock prevents updating the evaluator store simultaneously with an evaluation. - // This should provide a consistent view of the data at a given server/record version and - // avoid partial updates. - stateLock sync.RWMutex - tracerProvider oteltrace.TracerProvider tracer oteltrace.Tracer } diff --git a/authorize/grpc.go b/authorize/grpc.go index 69b26a167..f7da2ab0a 100644 --- a/authorize/grpc.go +++ b/authorize/grpc.go @@ -69,10 +69,7 @@ func (a *Authorize) Check(ctx context.Context, in *envoy_service_auth_v3.CheckRe return nil, err } - // take the state lock here so we don't update while evaluating - a.stateLock.RLock() res, err := state.evaluator.Evaluate(ctx, req) - a.stateLock.RUnlock() if err != nil { log.Ctx(ctx).Error().Err(err).Str("request-id", requestID).Msg("error during OPA evaluation") return nil, err