Address race conditions when booting a server process

This commit is contained in:
Dane Everitt
2020-07-18 10:10:34 -07:00
parent daf682b991
commit 21303dc517
2 changed files with 9 additions and 0 deletions

View File

@@ -33,6 +33,9 @@ func (s *Server) UpdateDataStructure(data []byte, background bool) error {
return errors.WithStack(err)
}
s.Lock()
defer s.Unlock()
// Don't explode if we're setting CPU limits to 0. Mergo sees that as an empty value
// so it won't override the value we've passed through in the API call. However, we can
// safely assume that we're passing through valid data structures here. I foresee this