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

[chore] Improve request cancelation handling in vis embeddable #65057

Merged
merged 2 commits into from
May 6, 2020

Conversation

Dosant
Copy link
Contributor

@Dosant Dosant commented May 4, 2020

Summary

Follow up on: #61279
This fixes an edge case of cancelation handling if cancelation is happed inside buildPipeline function. e.g. when calculating interval for a histogram.

For example,
currently, when calculating the interval for histogram and cancelation has happened, the error is swallowed, and we continue with expression execution for that request. Even though its result is no longer needed and we can reduce the amount of work and save some bandwidth.

(sorry, skipping test, as no existing suite for visualise_embeddable and no way to nicely cover it in functional suite)

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@Dosant Dosant added release_note:skip Skip the PR/issue when compiling release notes v8.0.0 v7.8.0 labels May 4, 2020
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

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

@Dosant Dosant marked this pull request as ready for review May 4, 2020 12:41
@Dosant Dosant requested a review from a team as a code owner May 4, 2020 12:41
@Dosant Dosant requested review from lizozom and ppisljar May 4, 2020 12:41
@@ -331,13 +331,14 @@ export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOut
this.abortController.abort();
}
this.abortController = new AbortController();
const abortController = this.abortController;
Copy link
Member

@ppisljar ppisljar May 5, 2020

Choose a reason for hiding this comment

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

why creating local variable ? if we have it lets use it everywhere, but without it this can be a one line PR.

Copy link
Contributor Author

@Dosant Dosant May 6, 2020

Choose a reason for hiding this comment

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

local variable here is needed as a reference to previous abortController instance.
when await buildPipeline is finished, in case it was aborted, this.abortController would be a reference from next request

Copy link
Member

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

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

code LGTM

@Dosant Dosant added the v7.9.0 label May 6, 2020
@Dosant Dosant merged commit 6114eba into elastic:master May 6, 2020
@Dosant Dosant deleted the dev/fix-cancelation-race branch May 6, 2020 08:58
gmmorris added a commit to gmmorris/kibana that referenced this pull request May 6, 2020
* master: (72 commits)
  add tsvb tests to Firefox suite (elastic#65425)
  Fix flaky ServerMetricsCollector integration test (elastic#65420)
  [APM] Custom links section inside the Actions menu is showing outside of the menu (elastic#65428)
  [ML] Adds docs_per_second to transform edit form. (elastic#65365)
  update apm index pattern (elastic#65424)
  add direct build command (elastic#65431)
  [ML] Adding daily_model_snapshot_retention_after_days to types and schemas (elastic#65417)
  [chore] Improve request cancelation handling in vis embeddable (elastic#65057)
  [Alerting] migrates acceptance and functional test fixtures to KP (elastic#64888)
  [ML] Fixes reordering in view by selection when overall cell selected (elastic#65290)
  Additional branding updates (elastic#64712)
  Remove redundant formatting of percentage column (elastic#64948)
  [SIEM][CASE] Configuration pages UI redesign (elastic#65355)
  New nav (elastic#64018)
  [Ingest pipelines] Address copy feedback (elastic#65175)
  bug fixing (elastic#65387)
  skip whole suite blocking snapshots (elastic#65377)
  add related event generation to ancestor nodes (fixes a bug) (elastic#64950)
  [Canvas] move files from legacy/plugins to plugins (elastic#65283)
  [SIEM] template timeline UI (elastic#64439)
  ...
Dosant added a commit to Dosant/kibana that referenced this pull request May 7, 2020
Dosant added a commit to Dosant/kibana that referenced this pull request May 7, 2020
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine kibanamachine added backport missing Added to PRs automatically when the are determined to be missing a backport. and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels May 8, 2020
Dosant added a commit that referenced this pull request May 8, 2020
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 v7.8.0 v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants