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
commit d444c2c001
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

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