Merge pull request #16323 from mheon/lock_during_kill

Ensure that StartAndAttach locks while sending signals
This commit is contained in:
OpenShift Merge Robot
2022-10-28 02:45:21 -04:00
committed by GitHub

View File

@ -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)
}