Skip to content

Commit

Permalink
Merge pull request #22662 from giuseppe/drop-ancient-conmon-check
Browse files Browse the repository at this point in the history
Revert "container stop: kill conmon"
  • Loading branch information
openshift-merge-bot[bot] authored May 13, 2024
2 parents 2e51803 + 8433a01 commit fcbe295
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions libpod/container_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,6 @@ func (c *Container) restartWithTimeout(ctx context.Context, timeout uint) (retEr
c.newContainerEvent(events.Restart)

if c.state.State == define.ContainerStateRunning {
conmonPID := c.state.ConmonPID
if err := c.stop(timeout); err != nil {
return err
}
Expand All @@ -1522,23 +1521,6 @@ func (c *Container) restartWithTimeout(ctx context.Context, timeout uint) (retEr
logrus.Error(err.Error())
}
}
// Old versions of conmon have a bug where they create the exit file before
// closing open file descriptors causing a race condition when restarting
// containers with open ports since we cannot bind the ports as they're not
// yet closed by conmon.
//
// Killing the old conmon PID is ~okay since it forces the FDs of old conmons
// to be closed, while it's a NOP for newer versions which should have
// exited already.
if conmonPID != 0 {
// Ignore errors from FindProcess() as conmon could already have exited.
p, err := os.FindProcess(conmonPID)
if p != nil && err == nil {
if err = p.Kill(); err != nil {
logrus.Debugf("error killing conmon process: %v", err)
}
}
}
// Ensure we tear down the container network so it will be
// recreated - otherwise, behavior of restart differs from stop
// and start
Expand Down

1 comment on commit fcbe295

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podman-next COPR build failed. @containers/packit-build please check.

Please sign in to comment.