Merge pull request #8130 from danlenar/main
Fix concurrent writes for UpdateContainerStats
This commit is contained in:
commit
887395aa12
@ -129,8 +129,8 @@ func (s *Store) List() []Sandbox {
|
||||
// stats present in 'newContainerStats'. Returns errdefs.ErrNotFound
|
||||
// if the sandbox does not exist in the store.
|
||||
func (s *Store) UpdateContainerStats(id string, newContainerStats *stats.ContainerStats) error {
|
||||
s.lock.RLock()
|
||||
defer s.lock.RUnlock()
|
||||
s.lock.Lock()
|
||||
defer s.lock.Unlock()
|
||||
id, err := s.idIndex.Get(id)
|
||||
if err != nil {
|
||||
if err == truncindex.ErrNotExist {
|
||||
|
Loading…
Reference in New Issue
Block a user