This repository was archived by the owner on Jan 30, 2020. It is now read-only.
Exit application if environment verification failed#75
Open
welandaz wants to merge 2 commits intoSixt:masterfrom
Open
Exit application if environment verification failed#75welandaz wants to merge 2 commits intoSixt:masterfrom
welandaz wants to merge 2 commits intoSixt:masterfrom
Conversation
Contributor
|
I see the point of what you are suggesting. However, the design is as it is intentionally. In a k8s environment, if you start-up, realize your environment isn't complete and exit the process, it will just result in a non-stop series of service restarts. I'm not sure that is any better than a stalled container (with a critical health status). |
Contributor
|
👍 having this control in the service sounds good to me |
Contributor
Author
Contributor
|
Those are two cases not relevant to the real-world use cases. The first would be found by testing the service before deploying, and the second is just a mis-use. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 of the Change
This change performs exit from Java process if AbstractService.verifyEnvironment() throws an exception during application start up.
Benefits
Currently, if method throws an exception, process stays alive, even though application won't function properly. This change makes sure, that if application's environment isn't valid (or something went wrong while trying to verify it), the program will terminate with the proper error logged. (Before, even though the message was logged, application continued to work in a broken state and could potentially confuse monitoring systems)
Possible Drawbacks
None, unless the semantic of AbstractService.verifyEnvironment() isn't supposed to be treated like that and it's ok to fail and not terminate the application (or if someone has been using it like that already, in which case after this fix application won't start unless no exception is thrown)