Skip to content
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

Reason for killing process when health check fails is not provided. #19

Open
hraftery opened this issue Oct 20, 2022 · 2 comments
Open

Comments

@hraftery
Copy link

This line seems problematic:

println!("{}", err);

because if health_cmd returns a non-zero exit status but nothing on stderr, the process is killed with no explanation. In my mind, that's a significant thing for the healthdog to do, and we'd want to know about it.

Unfortunately, in balenaOS it seems we tend to use balena-healthcheck as the health_cmd, which suppresses stderr with > /dev/null 2>&1. I checked, and via a long convoluted path, balena-engine-containerd-ctr itself does manage to write something useful to stderr, but we choose to suppress it.

I'll attach a support ticket where this led to a long investigation looking for a cause.

I think the resolution is either:

  1. if the expectation is that health_cmd reports failure with a non-zero exit code, as it seems to be, then healthdog should print an error saying the health_cmd failed, and include the err if available. It's relatively easy then to investigate why the health_cmd failed.
  2. if the expectation is that health_cmd also reports the reason for failure, then this should be made explicit, and the stderr suppression in balena-healthcheck should be removed.
@jellyfish-bot
Copy link

[hraftery] This has attached https://jel.ly.fish/0db480a8-e56c-4a3d-b94f-ef8141f98130

@hraftery
Copy link
Author

I see that resolving #16 might end up resolving this issue in another way. But I don't know how current that issue is because it says "we don't do anything actively" and I think the line of code I referenced and the one after (process::exit(1);) would qualify for "something".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants