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

Enable Watcher by default to fix bug in which Watcher doesn't render in the side nav #68602

Merged

Conversation

cjcenizal
Copy link
Contributor

@cjcenizal cjcenizal commented Jun 8, 2020

This bug is caused due to a race condition between the license check and the Management side nav rendering logic. A similar bug for CCR was fixed in 2c83f8c.

Release note

This fixes a regression in which Watcher will occasionally not render in the Management navigation.

…in the side nav due to race condition with license check.
@cjcenizal cjcenizal added release_note:fix Feature:Watcher v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.9.0 v7.8.1 v7.7.2 labels Jun 8, 2020
@cjcenizal cjcenizal requested a review from a team as a code owner June 8, 2020 23:35
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@cjcenizal cjcenizal requested a review from jloleysens June 8, 2020 23:47
@cjcenizal
Copy link
Contributor Author

CC @eddieturizo

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

Code changes look good to me, thanks for the explanation in the comment too.

I think this problem is one we could address by providing plugins which depend on licensing with the first resolved license synchronously and then getting subsequent licenses via the stream.

CC @restrry - I think we spoke about this at some point, would be good to hear your thoughts on this (or anyone) who has a better approach to how watcher is starting up.

// creates a race condition that can cause the app nav item to not render in the side nav.
// The race condition still exists, but it will result in the item rendering when it shouldn't
// (e.g. on a license it's not available for), instead of *not* rendering when it *should*,
// which is a less frustrating UX.
if (valid) {
watcherESApp.enable();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove this line now too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops sorry, I hit merge before I saw this comment! You're right, that line isn't necessary. Let's remove it in a subsequent PR, or perhaps leave it if we refactor this code to consume all events in the stream and not just the first one.

@cjcenizal cjcenizal merged commit 41af396 into elastic:master Jun 9, 2020
@cjcenizal cjcenizal deleted the bug/watcher-license-race-condition branch June 9, 2020 13:38
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jun 9, 2020
* master: (37 commits)
  [DOCS] Adds documentation for drilldowns (elastic#68122)
  [Telemetry] telemetry.sendUsageFrom: "server" by default (elastic#68071)
  [ML] Transforms: Support sub-aggregations (elastic#68306)
  Fixed pre-configured docs link points to the wrong page and functional tests configs (elastic#68606)
  [Ingest Manager] Update queries from `stream.*` to `dataset.*` (elastic#68322)
  Enable Watcher by default to fix bug in which Watcher doesn't render in the side nav (elastic#68602)
  Convert Index Templates API routes to snakecase. (elastic#68463)
  [SECURITY SOLUTION] [Detections] Add / Update e2e tests to ensure initial rule runs are successful (elastic#68441)
  [Ingest] OpenAPI spec file (elastic#68323)
  chore(NA): skip apis Endpoint plugin Endpoint policy api (elastic#68638)
  bumping makelogs version to v6.0.0 (elastic#66163)
  [SIEM] Add create template button (elastic#66613)
  Bump websocket-extensions from 0.1.3 to 0.1.4 (elastic#68414)
  [ML] Sample data modules - use event.dataset instead of index name (elastic#68538)
  [ML] Functional tests - fix job validation API test with maxModelMemoryLimit (elastic#68501)
  [ML] Functional tests - stabilize DFA job creation (elastic#68495)
  [TSVB] Allows the user to change the tooltip mode (elastic#67775)
  chore(NA): skip apis Endpoint plugin Endpoint alert API when data is in elasticsearch (elastic#68613)
  chore(NA): skip endpoint Endpoint Alert Page: when es has data and user has navigated to the page (elastic#68596)
  [SIEM][Detection Engine] Converts from joi to use io-ts and moves the types to common  (elastic#68127)
  ...
cjcenizal added a commit to cjcenizal/kibana that referenced this pull request Jun 9, 2020
cjcenizal added a commit to cjcenizal/kibana that referenced this pull request Jun 9, 2020
cjcenizal added a commit to cjcenizal/kibana that referenced this pull request Jun 9, 2020
cjcenizal added a commit that referenced this pull request Jun 9, 2020
cjcenizal added a commit that referenced this pull request Jun 9, 2020
cjcenizal added a commit that referenced this pull request Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Watcher release_note:fix Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.7.2 v7.8.1 v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants