Bug 2179369 - --health-on-failure=restart doesn't restart container
Summary: --health-on-failure=restart doesn't restart container
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: podman
Version: 38
Hardware: All
OS: All
unspecified
urgent
Target Milestone: ---
Assignee: Valentin Rothberg
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2180104 2180108
TreeView+ depends on / blocked
 
Reported: 2023-03-17 14:18 UTC by gary.revell@oracle.com
Modified: 2023-08-11 18:44 UTC (History)
15 users (show)

Fixed In Version:
Clone Of:
: 2180104 2180108 (view as bug list)
Environment:
Last Closed: 2023-04-24 17:34:58 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description gary.revell@oracle.com 2023-03-17 14:18:32 UTC
Description of problem:

I've been working on setting up health checks for our podman containers and have followed the instructions on this page:

https://www.redhat.com/sysadmin/podman-edge-healthcheck

It's mentioned that one of the --health-on-failure= options is restart so I tried it rather than kill which is given in the example.
However, it never appears to restart the container when the current one is set to unhealthy, is this a bug OR am I not using the option correctly?

$ podman run --replace -d --name test-container --health-cmd /healthcheck --health-on-failure=restart --health-retries=1 health-check-action


Version-Release number of selected component (if applicable):

podman version 4.3.1


How reproducible:

See the issue here for more details.

https://github.com/containers/podman/issues/17777

Steps to Reproduce:
1. As per example script & output in above issue.
2.
3.

Actual results:

Container was stopped and then exited.

Expected results:

Container should've restarted once the health command returned <> 0

Additional info:

Have worked with https://github.com/vrothberg to reproduce the error and he asked me to raise a bugzilla case.

Fix has been created:

https://github.com/containers/podman/pull/17830

Comment 1 Valentin Rothberg 2023-03-17 16:11:52 UTC
Thanks for opening the issue, Gary!

As you pointed out, we are working on a solution in https://github.com/containers/podman/pull/17830 and will keep you posted.

Comment 3 Valentin Rothberg 2023-03-21 11:51:46 UTC
A fix has been backported to the Podman 4.4 branch: https://github.com/containers/podman/pull/17862

It will be shipped with the upcoming Podman 4.4.3 release which is scheduled for tomorrow.

I also prepared backports for Podman 4.4.1 and 4.3.1 in RHEL.

Comment 4 Lokesh Mandvekar 2023-04-24 17:34:58 UTC
Closing. v4.4.3 and higher have been shipped in fedora.


Note You need to log in before you can comment on or make changes to this bug.