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

[kbn/optimizer] emit success event from reducer when all bundles cached #57945

Merged

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Feb 19, 2020

There is a bug in the base path proxy triggered when the dev server is started and all bundles are cached. In this case the optimizer will never enter the success phase, because the compilers never actually run. This same condition required #57871, and rather than implementing the same solution here I think we should just go into a success phase when all bundles are cached. The reason I didn't do this before is that the only place where this condition can be identified is in the state summarizer, which is powered by the RxJS scan() operator and as such couldn't produce both the "initialized" state and the "ready" state. Skipping the "initialized" state felt incorrect, so I instead relied on consumers doing the state.phase === 'initialized' && state.onlineBundles.length === 0 check to determine if the optimizer had cached all bundles.

In these changes the same condition still holds true, but now another event, the AllBundlesCachedEvent is injected when the OptimizerInitializedEvent is received and all bundles have been cached. When the state summarizer sees the AllBundlesCachedEvent it immediately moves the optimizer into the success phase.

Now that we're going into a success phase when all bundles are cached the completion handler and the phase check used to pause and unpause the base path proxy are a little more coherent, and should work well.

@spalger spalger added release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v7.7.0 v8.0.0 labels Feb 19, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@spalger spalger marked this pull request as ready for review February 19, 2020 12:24
@spalger spalger requested a review from a team as a code owner February 19, 2020 12:24
Copy link
Member

@mistic mistic left a comment

Choose a reason for hiding this comment

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

LGTM

@spalger
Copy link
Contributor Author

spalger commented Feb 19, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@spalger spalger merged commit fbae654 into elastic:master Feb 19, 2020
spalger pushed a commit to spalger/kibana that referenced this pull request Feb 19, 2020
…ed (elastic#57945)

* emit success event from reducer when all bundles cached

* verify that infinite streams can be broken by unsubscribing

* shift naming a smidge

Co-authored-by: Elastic Machine <[email protected]>
spalger pushed a commit that referenced this pull request Feb 19, 2020
…ed (#57945) (#58042)

* emit success event from reducer when all bundles cached

* verify that infinite streams can be broken by unsubscribing

* shift naming a smidge

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
@spalger
Copy link
Contributor Author

spalger commented Feb 19, 2020

7.x/7.7: 89f24ad

@spalger spalger deleted the implement/optimizer-cached-success-event branch February 19, 2020 22:09
mbondyra added a commit to mbondyra/kibana that referenced this pull request Feb 20, 2020
* master: (136 commits)
  [Visualize] Remove legacy appState in visualize (elastic#57330)
  Use static time for tsvb rollup test (elastic#57701)
  [SIEM] Fix ResizeObserver polyfill (elastic#58046)
  [SIEM][Detection Engine] Fixes return codes where some were rule_id instead of id
  skip flaky suite (elastic#56816)
  skip flaky suite (elastic#58059)
  skip flaky suite (elastic#45348)
  migrates notification server routes to NP (elastic#57906)
  Moved all of the show/hide toggles outside of ordered lists. (elastic#57163)
  [APM] NP Migration - Moves plugin server files out of legacy (elastic#57532)
  [Maps][Telemetry] Migrate Maps telemetry to NP (elastic#55055)
  Embeddable add panel examples (elastic#57319)
  Fix useRequest to support query change (elastic#57723)
  Allow custom paths in plugin generator (elastic#57766)
  [SIEM][Case] Merge header components (elastic#57816)
  [ML] New Platform server shim: update job audit messages routes (elastic#57925)
  [kbn/optimizer] emit success event from reducer when all bundles cached (elastic#57945)
  [APM] Don’t include UI filters when fetching a specific transaction (elastic#57934)
  Upgrade yargs (elastic#57720)
  skip flaky suite (elastic#57762) (elastic#57997) (elastic#57998)
  ...

# Conflicts:
#	src/plugins/advanced_settings/public/management_app/components/field/__snapshots__/field.test.tsx.snap
#	src/plugins/advanced_settings/public/management_app/components/field/field.tsx
#	x-pack/plugins/translations/translations/ja-JP.json
#	x-pack/plugins/translations/translations/zh-CN.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants