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

BUGFIX: fix globalHealth not returning to OK after a FAILED state #6

Merged
merged 3 commits into from Nov 15, 2022

Conversation

joelsdc
Copy link
Collaborator

@joelsdc joelsdc commented Nov 14, 2022

We have run into an issue where once a HC has FAILED, it will never go back to OK.

This is because on each healthcheck.Check() we scan for failed checks, if any check fails, we set the global health to false and return a 503. On subsequent checks, if all results are OK, there is not code to set the global health back to OK.

This PR ensures we start from an OK state on each check, if any checks fail, we set the global state to false. On subsequent requests, we set back to OK prior to doing the checks, so if any checks fail it will be set again to FALSE before replying, and if all checks are OK, the OK state is kept.

@adrianlop @jeevatkm please let me know your thoughts on this.

As this is a bugfix, we should tag a new version.

@adrianlop
Copy link
Collaborator

adrianlop commented Nov 15, 2022

@joelsdc @jeevatkm please check #7

good catch btw 😄

@joelsdc
Copy link
Collaborator Author

joelsdc commented Nov 15, 2022

PR updated with the changes @adrianlop proposed.

Please review and if it looks good we can merge and create a new release.

Copy link
Member

@jeevatkm jeevatkm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joelsdc Changes look good; we can merge them. I just noticed Travis CI build blocking the PR, and it's no longer free for open source. I think its better to use GitHub actions.

@jeevatkm jeevatkm merged commit 0aa2b34 into master Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants