Skip to content

Commit

Permalink
Fixes occasional data race flake with TestSDKServerAddListValue
Browse files Browse the repository at this point in the history
Puts gsListUpdates call after the mutex lock
  • Loading branch information
igooch committed Nov 14, 2023
1 parent 28eebb9 commit b026150
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/sdkserver/sdkserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b026150

Please sign in to comment.