Skip to content

[6.3] [xpack_main/status] update the plugin status anytime the license changes (#20018)#20095

Merged
spalger merged 1 commit intoelastic:6.3from
spalger:backport/6.3/pr-20018
Jun 20, 2018
Merged

[6.3] [xpack_main/status] update the plugin status anytime the license changes (#20018)#20095
spalger merged 1 commit intoelastic:6.3from
spalger:backport/6.3/pr-20018

Conversation

@spalger
Copy link
Copy Markdown
Contributor

@spalger spalger commented Jun 20, 2018

Backports the following commits to 6.3:

…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.

![screen shot 2018-06-18 at 3 25 47 pm](https://user-images.githubusercontent.com/1329312/41565769-ff032dc0-730c-11e8-978e-3e28ced18448.png)
@spalger spalger added the backport This PR is a backport of another PR label Jun 20, 2018
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@spalger spalger merged commit 7d21b6e into elastic:6.3 Jun 20, 2018
@spalger spalger deleted the backport/6.3/pr-20018 branch June 20, 2018 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants