Support for multiple HealthChecks that resolve to a single health check status#117
Open
elandau wants to merge 1 commit intoNetflix:masterfrom
Open
Support for multiple HealthChecks that resolve to a single health check status#117elandau wants to merge 1 commit intoNetflix:masterfrom
elandau wants to merge 1 commit intoNetflix:masterfrom
Conversation
|
karyon-pull-requests #101 FAILURE |
There was a problem hiding this comment.
Since we are moving away from single boolean, why not introduce a more complete service status model with { Starting, PartiallyReady, Ready, Down, Error } states?
There is different semantic associated with each:
- Starting - some time in the future I will be ready
- PartiallyReady - I am providing limited service, possibly due to problem with communicating with backend services
- Read - complete set of services provided
- Down - state after service/library shutdown call was made
- Error - any other error condition (with associated cause)
Contributor
Author
There was a problem hiding this comment.
With this solution I'm trying to minimize the different states being tracked and instead opt to have multiple conditions. The above states can be modeled using the following conditions
- Starting
- Healthcheck
- Terminating
Each of these conditions would have a boolean ok/bad as well as an optional error. So a failure to start would have 'starting' set to false with error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The current Karyon and Eureka health check implementation attempts to consolidate multiple health states into a single status in a way that uses unwieldy dependencies between various conditions for health check. This PR provides a generic solution through which multiple HealthCheck components may be registered and resolved into a single strategy using a plugable strategy.
Several new concepts are introduced here,
(isReady=false, error=null) Component is initializing
(isReady=false, error=nonnull) Component failed to initialize
(isReady=true, error=null) Component has been initialized and is working properly
Note that this implementation depends on a (yet to be issued) update to eureka where ApplicationInfoManager tracks an InstanceStatus separately instead of setting that status directly on the singleton InstanceInfo. This solves various race conditions whereby the InstanceInfo status can be updated independently outside of the context of healthcheck.
An example use case for this mechanism is to track an application's healthcheck using 3 conditions.
All 3 conditions must be set to a healthy status for an InstanceInfo.UP status to be set on the eureka client