summaryrefslogtreecommitdiff
path: root/vendor/github.com
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-09-12 16:56:10 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-09-12 23:27:09 +0000
commitfacab2aec561c6d06ae2789dfaffa28b7f273c88 (patch)
tree47ee7b01f6225f7b6c7923e7593685c32fc3eb0a /vendor/github.com
parent08936c32417a87d61b3b33a155dc0679dff73bff (diff)
downloadpodman-facab2aec561c6d06ae2789dfaffa28b7f273c88.tar.gz
podman-facab2aec561c6d06ae2789dfaffa28b7f273c88.tar.bz2
podman-facab2aec561c6d06ae2789dfaffa28b7f273c88.zip
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 <dwalsh@redhat.com> Closes: #1454 Approved by: mheon
Diffstat (limited to 'vendor/github.com')
-rw-r--r--vendor/github.com/containers/storage/store.go23
1 files changed, 14 insertions, 9 deletions
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
}