mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +08:00
Merge pull request #16323 from mheon/lock_during_kill
Ensure that StartAndAttach locks while sending signals
This commit is contained in:
@ -282,6 +282,8 @@ func (c *Container) Attach(streams *define.AttachStreams, keys string, resize <-
|
|||||||
if c.Terminal() {
|
if c.Terminal() {
|
||||||
go func() {
|
go func() {
|
||||||
<-attachRdy
|
<-attachRdy
|
||||||
|
c.lock.Lock()
|
||||||
|
defer c.lock.Unlock()
|
||||||
if err := c.ociRuntime.KillContainer(c, uint(signal.SIGWINCH), false); err != nil {
|
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)
|
logrus.Warnf("Unable to send SIGWINCH to container %s after attach: %v", c.ID(), err)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user