From b026150c757301f1107f93b4e1ac2198682c92fe Mon Sep 17 00:00:00 2001 From: Ivy Gooch Date: Tue, 14 Nov 2023 03:37:01 +0000 Subject: [PATCH] Fixes occasional data race flake with TestSDKServerAddListValue Puts gsListUpdates call after the mutex lock --- pkg/sdkserver/sdkserver.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/sdkserver/sdkserver.go b/pkg/sdkserver/sdkserver.go index 74b5e3d94d..93b5e47e0f 100644 --- a/pkg/sdkserver/sdkserver.go +++ b/pkg/sdkserver/sdkserver.go @@ -1175,10 +1175,11 @@ func (s *SDKServer) updateList(ctx context.Context) error { } gsCopy := gs.DeepCopy() - s.logger.WithField("batchListUpdates", s.gsListUpdates).Debug("Batch updating List(s)") s.gsUpdateMutex.Lock() defer s.gsUpdateMutex.Unlock() + s.logger.WithField("batchListUpdates", s.gsListUpdates).Debug("Batch updating List(s)") + names := []string{} for name, listReq := range s.gsListUpdates {