Skip to content

Commit

Permalink
Merge pull request #16323 from mheon/lock_during_kill
Browse files Browse the repository at this point in the history
Ensure that StartAndAttach locks while sending signals
  • Loading branch information
openshift-merge-robot authored Oct 28, 2022
2 parents 25b5ee6 + 871172e commit d444c2c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libpod/container_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ func (c *Container) Attach(streams *define.AttachStreams, keys string, resize <-
if c.Terminal() {
go func() {
<-attachRdy
c.lock.Lock()
defer c.lock.Unlock()
if err := c.ociRuntime.KillContainer(c, uint(signal.SIGWINCH), false); err != nil {
logrus.Warnf("Unable to send SIGWINCH to container %s after attach: %v", c.ID(), err)
}
Expand Down

0 comments on commit d444c2c

Please sign in to comment.