mirror of
https://github.com/containers/podman.git
synced 2025-08-06 03:19:52 +08:00
Fix locking interaction in batched Exec() on container
Signed-off-by: Matthew Heon <mheon@redhat.com> Closes: #610 Approved by: giuseppe
This commit is contained in:
@ -376,14 +376,18 @@ func (c *Container) Exec(tty, privileged bool, env, cmd []string, user string) e
|
||||
logrus.Debugf("Successfully started exec session %s in container %s", sessionID, c.ID())
|
||||
|
||||
// Unlock so other processes can use the container
|
||||
c.lock.Unlock()
|
||||
locked = false
|
||||
if !c.locked {
|
||||
c.lock.Unlock()
|
||||
locked = false
|
||||
}
|
||||
|
||||
waitErr := execCmd.Wait()
|
||||
|
||||
// Lock again
|
||||
locked = true
|
||||
c.lock.Lock()
|
||||
if !c.locked {
|
||||
locked = true
|
||||
c.lock.Lock()
|
||||
}
|
||||
|
||||
// Sync the container again to pick up changes in state
|
||||
if err := c.syncContainer(); err != nil {
|
||||
|
Reference in New Issue
Block a user