summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-06-23 04:25:44 -0400
committerGitHub <noreply@github.com>2021-06-23 04:25:44 -0400
commite159eb892b969a035f6f34239369771536ff4a9b (patch)
treef2b8b70edcb4033047833bd11920acbaf74cb189
parentd3afc6b3b6d6ba1d900b74d24affb132f38622d3 (diff)
parenta84fa194b76dfd1776e01e192529d73ee32389ca (diff)
downloadpodman-e159eb892b969a035f6f34239369771536ff4a9b.tar.gz
podman-e159eb892b969a035f6f34239369771536ff4a9b.tar.bz2
podman-e159eb892b969a035f6f34239369771536ff4a9b.zip
Merge pull request #10754 from Luap99/sync-lock
getContainerNetworkInfo: lock netNsCtr before sync
-rw-r--r--libpod/networking_linux.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go
index 9145569fb..1b775a4f3 100644
--- a/libpod/networking_linux.go
+++ b/libpod/networking_linux.go
@@ -908,6 +908,10 @@ func (c *Container) getContainerNetworkInfo() (*define.InspectNetworkSettings, e
if err != nil {
return nil, err
}
+ // see https://github.com/containers/podman/issues/10090
+ // the container has to be locked for syncContainer()
+ netNsCtr.lock.Lock()
+ defer netNsCtr.lock.Unlock()
// Have to sync to ensure that state is populated
if err := netNsCtr.syncContainer(); err != nil {
return nil, err