From facab2aec561c6d06ae2789dfaffa28b7f273c88 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Wed, 12 Sep 2018 16:56:10 -0400 Subject: Vendor in latest containers/storage to eliminage deadlock When running lots of podman commands simultaneously we were able to get into a deadlock situation. The updated containers/storage should fix this issue. Signed-off-by: Daniel J Walsh Closes: #1454 Approved by: mheon --- vendor.conf | 2 +- vendor/github.com/containers/storage/store.go | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/vendor.conf b/vendor.conf index a50d3822e..390615dfa 100644 --- a/vendor.conf +++ b/vendor.conf @@ -11,7 +11,7 @@ github.com/containerd/continuity master github.com/containernetworking/cni v0.7.0-alpha1 github.com/containernetworking/plugins 1562a1e60ed101aacc5e08ed9dbeba8e9f3d4ec1 github.com/containers/image 5df44e095ed826fbe2beeaabb329c749d7d6c3b6 -github.com/containers/storage d0cb0107646058ad96ce90630fee2bd5709ee637 +github.com/containers/storage 243c4cd616afdf06b4a975f18c4db083d26b1641 github.com/containers/psgo 5dde6da0bc8831b35243a847625bcf18183bd1ee github.com/coreos/go-systemd v14 github.com/cri-o/ocicni master diff --git a/vendor/github.com/containers/storage/store.go b/vendor/github.com/containers/storage/store.go index 33b91a353..e0deb2c30 100644 --- a/vendor/github.com/containers/storage/store.go +++ b/vendor/github.com/containers/storage/store.go @@ -1091,11 +1091,6 @@ func (s *store) CreateContainer(id string, names []string, image, layer, metadat if err != nil { return nil, err } - rlstore.Lock() - defer rlstore.Unlock() - if modified, err := rlstore.Modified(); modified || err != nil { - rlstore.Load() - } if id == "" { id = stringid.GenerateRandomID() } @@ -1108,6 +1103,10 @@ func (s *store) CreateContainer(id string, names []string, image, layer, metadat idMappingsOptions := options.IDMappingOptions if image != "" { var imageHomeStore ROImageStore + lstores, err := s.ROLayerStores() + if err != nil { + return nil, err + } istore, err := s.ImageStore() if err != nil { return nil, err @@ -1116,6 +1115,11 @@ func (s *store) CreateContainer(id string, names []string, image, layer, metadat if err != nil { return nil, err } + rlstore.Lock() + defer rlstore.Unlock() + if modified, err := rlstore.Modified(); modified || err != nil { + rlstore.Load() + } var cimage *Image for _, store := range append([]ROImageStore{istore}, istores...) { store.Lock() @@ -1134,10 +1138,6 @@ func (s *store) CreateContainer(id string, names []string, image, layer, metadat } imageID = cimage.ID - lstores, err := s.ROLayerStores() - if err != nil { - return nil, err - } ilayer, err := s.imageTopLayerForMapping(cimage, imageHomeStore, imageHomeStore == istore, rlstore, lstores, idMappingsOptions) if err != nil { return nil, err @@ -1150,6 +1150,11 @@ func (s *store) CreateContainer(id string, names []string, image, layer, metadat gidMap = ilayer.GIDMap } } else { + rlstore.Lock() + defer rlstore.Unlock() + if modified, err := rlstore.Modified(); modified || err != nil { + rlstore.Load() + } if !options.HostUIDMapping && len(options.UIDMap) == 0 { uidMap = s.uidMap } -- cgit v1.2.3-54-g00ecf