libpod: inhibit SIGTERM during cleanup()

The network cleanup can handle it when it is killed half way through as
it spits out a bunch of error in that case on the next cleanup attempt.
Try to avoid getting into such a state and ignore sigterm during this
section.

Of course we stil can get SIGKILL so we should work on fixing the
underlying problems in network cleanup but let's see if this helps us
with the CI flakes in the meantime.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2024-07-31 19:00:16 +02:00
parent ebc7debbb0
commit 7610cedc80

View File

@ -2046,6 +2046,11 @@ func (c *Container) cleanup(ctx context.Context) error {
logrus.Debugf("Cleaning up container %s", c.ID())
// Ensure we are not killed half way through cleanup
// which can leave us in a bad state.
shutdown.Inhibit()
defer shutdown.Uninhibit()
// Remove healthcheck unit/timer file if it execs
if c.config.HealthCheckConfig != nil {
if err := c.removeTransientFiles(ctx,