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

[Lens] bsearch not aborted after changing the layers #123030

Closed
afharo opened this issue Jan 14, 2022 · 3 comments · Fixed by #125520
Closed

[Lens] bsearch not aborted after changing the layers #123030

afharo opened this issue Jan 14, 2022 · 3 comments · Fixed by #125520
Labels
bug Fixes for quality problems that affect the customer experience Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:small Small Level of Effort TestWeek-8.0 triage_needed

Comments

@afharo
Copy link
Member

afharo commented Jan 14, 2022

Kibana version: 8.0.0-rc1

Original install method (e.g. download page, yum, from source, etc.): Cloud deployment

Describe the bug:
After adding a field to break-down by in Lens, the main viz finished loading, but one of the suggestions in the graph kept loading. I changed my mind and changed/removed the break-down by field. The previously cached viz loaded instantly (including the suggestions). However, there's still the bsearch polling happening (and the load indicator on the top-left corner keeps spinning).

IMO, the polling should stop if that viz has changed.

Steps to reproduce:

  1. Open Lens
  2. Create any viz, breaking by a field. Try to make the query a long-running one to make it easier to test.
  3. While the suggestions are loading, remove the break-by.
  4. Notice that the bsearch request keeps polling because the previous query never finished.

Expected behavior:
IMO, the polling should stop if that viz has changed.

Screenshots (if relevant):

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):

Any additional context:

@afharo afharo added bug Fixes for quality problems that affect the customer experience Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens TestWeek-8.0 labels Jan 14, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)

@kibanamachine kibanamachine added this to Long-term goals in Lens Jan 14, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServicesSv)

@flash1293
Copy link
Contributor

That's a great catch. It took me a bit to trace it to the root source, but it seems to be a general issue with how partial results and expression executions work.

The loader will cancel an ongoing expression if the execution will return isPending === true:

if (this.execution && this.execution.isPending) {

It will return false if the state of the execution is result:

const finished = state === 'error' || state === 'result';

However the state is set to result as soon as the setResult transition is triggered:

As you can see here, this also happens on partial data arriving (in this situation the result of the state has a flag partial):
Screenshot 2022-01-27 at 12 22 22

On changing the isPending logic to check for this flag, the execution gets cancelled correctly:
Screenshot 2022-01-27 at 12 23 06

@ppisljar @dokmic Could you check this out?

@flash1293 flash1293 added Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) and removed Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Jan 27, 2022
@kibanamachine kibanamachine removed this from Long-term goals in Lens Jan 27, 2022
@exalate-issue-sync exalate-issue-sync bot added impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. loe:small Small Level of Effort impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. and removed impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. labels Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:small Small Level of Effort TestWeek-8.0 triage_needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants