[xpack_main/status] update the plugin status anytime the license changes#20018
Merged
spalger merged 4 commits intoelastic:masterfrom Jun 20, 2018
Merged
[xpack_main/status] update the plugin status anytime the license changes#20018spalger merged 4 commits intoelastic:masterfrom
spalger merged 4 commits intoelastic:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
…o_stuck_red_status
This comment has been minimized.
This comment has been minimized.
added 2 commits
June 19, 2018 13:05
…o_stuck_red_status
Contributor
💚 Build Succeeded |
tsullivan
reviewed
Jun 19, 2018
|
|
||
| this._cache = { response }; | ||
|
|
||
| if (licenseInfoChanged) { |
Member
There was a problem hiding this comment.
any reason why this is not in the same block that starts on 137?
Contributor
Author
There was a problem hiding this comment.
Yeah, the listeners could very well be calling methods on the XpackInfo instance that access the cache, like isAvailable() and unavailableReason() are in the xpack_main listener. I doubt there's a reason the cache needs to be updated after the log line, but I didn't want to change the order of things unnecessarily.
spalger
pushed a commit
to spalger/kibana
that referenced
this pull request
Jun 20, 2018
…ges (elastic#20018) Fixes elastic#20017 Currently the xpack_main plugin only sets its status when the elasticsearch plugin changes status, which is a fine signal that the plugin should recheck for the license info, but not the only time it can be updated. At some point recently a race condition became more likely to be triggered, which is detailed in elastic#20017 (comment) and causes the xpack_main plugin to set its status to red and never return it to green, even after the license info is successfully fetched from Elasticsearch. To fix this the `XpackInfo` class now exposes the `onLicenseInfoChange(handler)` method which will call the handler whenever the xpack info changes. This way the xpack_main plugin can reflect the current state of the license info in its status and doesn't have to wait for the elasticsearch plugin to change status again. To test this I recommend running kibana with `--elasticsearch.healthCheck.delay=500` or even `250`, and then starting Elasticsearch after Kibana has started. Without this change Kibana is very likely to attempt a healthcheck between the time that Elasticsearch is "started" and the x-pack license info is completely loaded, triggering the race condition. With this change you should see the xpack info plugin (and all other xpack plugins) go red with a more informative message, and then after the first request or 30 second polling timer, the plugins should go green again. 
spalger
pushed a commit
to spalger/kibana
that referenced
this pull request
Jun 20, 2018
…ges (elastic#20018) Fixes elastic#20017 Currently the xpack_main plugin only sets its status when the elasticsearch plugin changes status, which is a fine signal that the plugin should recheck for the license info, but not the only time it can be updated. At some point recently a race condition became more likely to be triggered, which is detailed in elastic#20017 (comment) and causes the xpack_main plugin to set its status to red and never return it to green, even after the license info is successfully fetched from Elasticsearch. To fix this the `XpackInfo` class now exposes the `onLicenseInfoChange(handler)` method which will call the handler whenever the xpack info changes. This way the xpack_main plugin can reflect the current state of the license info in its status and doesn't have to wait for the elasticsearch plugin to change status again. To test this I recommend running kibana with `--elasticsearch.healthCheck.delay=500` or even `250`, and then starting Elasticsearch after Kibana has started. Without this change Kibana is very likely to attempt a healthcheck between the time that Elasticsearch is "started" and the x-pack license info is completely loaded, triggering the race condition. With this change you should see the xpack info plugin (and all other xpack plugins) go red with a more informative message, and then after the first request or 30 second polling timer, the plugins should go green again. 
Contributor
Author
Contributor
💚 Build Succeeded |
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.
Fixes #20017
Currently the xpack_main plugin only sets its status when the elasticsearch plugin changes status, which is a fine signal that the plugin should recheck for the license info, but not the only time it can be updated. At some point recently a race condition became more likely to be triggered, which is detailed in #20017 (comment) and causes the xpack_main plugin to set its status to red and never return it to green, even after the license info is successfully fetched from Elasticsearch.
To fix this the
XpackInfoclass now exposes theonLicenseInfoChange(handler)method which will call the handler whenever the xpack info changes. This way the xpack_main plugin can reflect the current state of the license info in its status and doesn't have to wait for the elasticsearch plugin to change status again.To test this I recommend running kibana with
--elasticsearch.healthCheck.delay=500or even250, and then starting Elasticsearch after Kibana has started. Without this change Kibana is very likely to attempt a healthcheck between the time that Elasticsearch is "started" and the x-pack license info is completely loaded, triggering the race condition. With this change you should see the xpack info plugin (and all other xpack plugins) go red with a more informative message, and then after the first request or 30 second polling timer, the plugins should go green again.release note:
When using X-Pack it was previously possible for Kibana to get stuck in a "red" state, preventing access to the Kibana applications, if Kibana and Elasticsearch were started at the same time. We've fixed this issue to ensure that Kibana will always been usable when it's able to talk to Elasticsearch.