-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
native healthchecks are unreliable/inconsistent #5915
Comments
@baude PTAL |
Hello! ReproducerDockerfile:
healthcheck #!/bin/sh
echo 'This is a success'
exit 0 init.sh #!/bin/sh
while :; do
sleep 30
done Methodology
Break the healthcheck
You can run the following in order to always have the healthcheck status as reported by podman inspect: Issues
{
"OciVersion": "1.0.1-dev",
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 70624,
"ConmonPid": 70612,
"ExitCode": 0,
"Error": "",
"StartedAt": "2020-04-23T07:50:06.660901138Z",
"FinishedAt": "0001-01-01T00:00:00Z",
"Healthcheck": {
"Status": "starting",
"FailingStreak": 0,
"Log": [
{
"Start": "2020-04-22T14:46:01.170792682Z",
"End": "2020-04-22T14:46:01.618066347Z",
"ExitCode": 0,
"Output": ""
},
{
"Start": "2020-04-22T14:46:02.233518944Z",
"End": "2020-04-22T14:46:02.690192626Z",
"ExitCode": 0,
"Output": ""
},
{
"Start": "2020-04-22T14:46:03.171000823Z",
"End": "2020-04-22T14:46:03.616105101Z",
"ExitCode": 0,
"Output": ""
},
{
"Start": "2020-04-22T14:46:04.112180387Z",
"End": "2020-04-22T14:46:04.54862729Z",
"ExitCode": 0,
"Output": ""
},
{
"Start": "2020-04-22T14:46:04.97645628Z",
"End": "2020-04-22T14:46:05.431782197Z",
"ExitCode": 0,
"Output": ""
}
]
}
} |
After even more digging, I found a potential reason: Since the log doesn't have any mention of the container, it might explain why "podman inspect" doesn't report the right state. Now, about the location:
So. Question: is the healthcheck.log location built on some "dirname(LogPath)"? This would explain a lot. And a correction would be really simple and easy, something like: Does it make any sense? Did I just find the root cause? :) |
instead of using the container log path to derive where to put the healthchecks, we now put them into the rundir to avoid collision of health check log files when the log path is set by user. Fixes: containers#5915 Signed-off-by: Brent Baude <[email protected]>
instead of using the container log path to derive where to put the healthchecks, we now put them into the rundir to avoid collision of health check log files when the log path is set by user. Fixes: containers#5915 Signed-off-by: Brent Baude <[email protected]>
instead of using the container log path to derive where to put the healthchecks, we now put them into the rundir to avoid collision of health check log files when the log path is set by user. Fixes: containers#5915 Signed-off-by: Brent Baude <[email protected]>
instead of using the container log path to derive where to put the healthchecks, we now put them into the rundir to avoid collision of health check log files when the log path is set by user. Fixes: containers#5915 Signed-off-by: Brent Baude <[email protected]>
instead of using the container log path to derive where to put the healthchecks, we now put them into the rundir to avoid collision of health check log files when the log path is set by user. Fixes: containers#5915 Signed-off-by: Brent Baude <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Using native podman healthcheck feature is unreliable since there are inconsistencies between live state and the state reported within "inspect". For instance:
while:
The right state is the latter, I've broken on purpose the healthcheck in order to do some tests....
Steps to reproduce the issue:
Describe the results you received:
We don't get the right result in the "inspect" output
Describe the results you expected:
We should get the correct result
Additional information you deem important (e.g. issue happens only occasionally):
The full inspect output, since there are other healthcheck-related things in the Config block. Maybe we did it wrong?
https://gist.github.com/cjeanner/1b1ba82eae7331c2c688ded4dcf8d111
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):The text was updated successfully, but these errors were encountered: