Update healthchecks to handle ldd failures #1137
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Relates to #1056 which added more rigorous checks to the
ldd
healthchecksThe scenario is - I've just upgraded to a newer version of Omnibus, and it looks like the
ldd
command here can break halfway through with this current pattern. It took a while to track down things as the status code here is getting ignored, so the error was being swallowed.Example, reading 3 files and the 2nd ELF file causes an error - shows that the third file is never evaluated - leading to incorrect health checks:
We get a partial result in the current implementation, but if you extract the status code you can see it has failed an exitstatus of 135:
For my current setup, this new code path skips multiple healthchecks as a result of exiting earlier than expect
Intended solution
For the happy path, the
ldd
command is run against all libraries as before. If the exit code is non-zero, we try the failed files indivdually.Maintainers
Please ensure that you check for:
serial number
corresponding change is reviewed and there is a release plan
corresponding change is reviewed and there is a release plan