Skip to content

Commit e159eb8

Browse files
Merge pull request containers#10754 from Luap99/sync-lock
getContainerNetworkInfo: lock netNsCtr before sync
2 parents d3afc6b + a84fa19 commit e159eb8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libpod/networking_linux.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,10 @@ func (c *Container) getContainerNetworkInfo() (*define.InspectNetworkSettings, e
908908
if err != nil {
909909
return nil, err
910910
}
911+
// see https://github.com/containers/podman/issues/10090
912+
// the container has to be locked for syncContainer()
913+
netNsCtr.lock.Lock()
914+
defer netNsCtr.lock.Unlock()
911915
// Have to sync to ensure that state is populated
912916
if err := netNsCtr.syncContainer(); err != nil {
913917
return nil, err

0 commit comments

Comments
 (0)