Bug 2180125

Summary: --health-on-failure=restart doesn't restart container [rhel-8.8.0.z]
Product: Red Hat Enterprise Linux 8 Reporter: RHEL Program Management Team <pgm-rhel-tools>
Component: podmanAssignee: Jindrich Novy <jnovy>
Status: CLOSED ERRATA QA Contact: Alex Jia <ajia>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 8.9CC: acui, bbaude, container-sig, debarshir, dwalsh, extras-qa, gary.revell, go-sig, jligon, jnovy, lsm5, mboddu, mheon, patrick, pehunt, pthomas, rh.container.bot, santiago, tsweeney, umohnani, vrothber, ypu
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: podman-4.4.1-8.el8_8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2180104 Environment:
Last Closed: 2023-05-16 10:01:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2180104    
Bug Blocks:    

Comment 1 Tom Sweeney 2023-03-20 19:07:13 UTC
Valentin, please use this BZ and https://bugzilla.redhat.com/show_bug.cgi?id=2180126 to merge into the Podman v4.4.1-rhel branch when your patch there is ready.

Comment 2 Valentin Rothberg 2023-03-21 08:21:38 UTC
Opened PR: https://github.com/containers/podman/pull/17863

Comment 3 Valentin Rothberg 2023-03-21 11:53:55 UTC
PR has merged, assigning to Jindrich.

Comment 7 Alex Jia 2023-03-23 10:32:29 UTC
This bug has been verified on podman-4.4.1-8.module+el8.8.0+18438+15d3aa65.

[root@kvm-04-guest20 ~]# sh -x test.sh 
+ IMG=ubi8
+ podman ps -a
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES
+ podman run --replace -d --name true_container --health-cmd true --health-on-failure=restart --health-interval 15s --health-retries=2 ubi8 sleep 300
42abedc89733dcdd97e58866c390c82a3601a0c87a644d8cb21f863d097e514f
+ podman run --replace -d --name false_container --health-cmd false --health-on-failure=restart --health-interval 15s --health-retries=2 ubi8 sleep 300
726ea8bf4ebc93a2e3d57299de8e2449bc0a32d54083f34a6994461a2956c8e2
++ date +%H:%M:%S
+ echo 06:24:37 Created false_container
06:24:37 Created false_container
+ true
+ sleep 5
+ date +%H:%M:%S
06:24:42
+ podman ps -a
CONTAINER ID  IMAGE                                   COMMAND     CREATED        STATUS                   PORTS       NAMES
42abedc89733  registry.access.redhat.com/ubi8:latest  sleep 300   6 seconds ago  Up 6 seconds (healthy)               true_container
726ea8bf4ebc  registry.access.redhat.com/ubi8:latest  sleep 300   5 seconds ago  Up 5 seconds (starting)              false_container
+ true
+ sleep 5
+ date +%H:%M:%S
06:24:47
+ podman ps -a
CONTAINER ID  IMAGE                                   COMMAND     CREATED         STATUS                    PORTS       NAMES
42abedc89733  registry.access.redhat.com/ubi8:latest  sleep 300   11 seconds ago  Up 11 seconds (healthy)               true_container
726ea8bf4ebc  registry.access.redhat.com/ubi8:latest  sleep 300   10 seconds ago  Up 10 seconds (starting)              false_container
+ true
+ sleep 5
+ date +%H:%M:%S
06:24:52
+ podman ps -a
CONTAINER ID  IMAGE                                   COMMAND     CREATED         STATUS                    PORTS       NAMES
42abedc89733  registry.access.redhat.com/ubi8:latest  sleep 300   16 seconds ago  Up 16 seconds (healthy)               true_container
726ea8bf4ebc  registry.access.redhat.com/ubi8:latest  sleep 300   15 seconds ago  Up 15 seconds (starting)              false_container
+ true
+ sleep 5
+ date +%H:%M:%S
06:24:57
+ podman ps -a
CONTAINER ID  IMAGE                                   COMMAND     CREATED         STATUS                   PORTS       NAMES
42abedc89733  registry.access.redhat.com/ubi8:latest  sleep 300   21 seconds ago  Up 21 seconds (healthy)              true_container
726ea8bf4ebc  registry.access.redhat.com/ubi8:latest  sleep 300   20 seconds ago  Stopping (unhealthy)                 false_container
+ true
+ sleep 5
+ date +%H:%M:%S
06:25:02
+ podman ps -a
CONTAINER ID  IMAGE                                   COMMAND     CREATED         STATUS                   PORTS       NAMES
42abedc89733  registry.access.redhat.com/ubi8:latest  sleep 300   26 seconds ago  Up 26 seconds (healthy)              true_container
726ea8bf4ebc  registry.access.redhat.com/ubi8:latest  sleep 300   25 seconds ago  Stopping (unhealthy)                 false_container
+ true
+ sleep 5
+ date +%H:%M:%S
06:25:07
+ podman ps -a
CONTAINER ID  IMAGE                                   COMMAND     CREATED         STATUS                   PORTS       NAMES
42abedc89733  registry.access.redhat.com/ubi8:latest  sleep 300   31 seconds ago  Up 31 seconds (healthy)              true_container
726ea8bf4ebc  registry.access.redhat.com/ubi8:latest  sleep 300   30 seconds ago  Up 4 seconds (starting)              false_container
...ignore...

Comment 12 errata-xmlrpc 2023-05-16 10:01:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (container-tools:rhel8 bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:3089