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 editor gets into infinite search loop when searches take a while to complete and relative time range is used #124219

Closed
lizozom opened this issue Feb 1, 2022 · 12 comments · Fixed by #124389
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@lizozom
Copy link
Contributor

lizozom commented Feb 1, 2022

Kibana version:
7.16.1

Describe the bug:
I created a visualization containing a scripted field (not a runtime field).
Loading it for last 15 minutes sends kibana into an endless bsearch loop and it never finishes to load (I waited for over 3 minutes).

Steps to reproduce:

  1. Go to this visualization
  2. It never finishes to load properly

Expected behavior:
Visualization should either load or terminate \ show an error.

Screenshots (if relevant):
image
image

Errors in browser console (if relevant):

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

Any additional context:

@lizozom lizozom added bug Fixes for quality problems that affect the customer experience Team:AppServicesSv labels Feb 1, 2022
@elasticmachine
Copy link
Contributor

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

@flash1293
Copy link
Contributor

flash1293 commented Feb 1, 2022

Looks like a duplicate of #123030 , I already investigated the problem there. Waiting for input from @ppisljar and @dokmic

Edit: Oh wait, it's related to scripted fields, probably a separate issue, my bad.

@lizozom
Copy link
Contributor Author

lizozom commented Feb 1, 2022

@flash1293 I think both problems are happening simultaneously there

@Dosant
Copy link
Contributor

Dosant commented Feb 1, 2022

@flash1293, could it be that Lens editor re-runs the search in case the previous search took a long time to load (~1 minute)?

Maybe this code is executed when we got search results that took a while to load and lens triggers refetch?

if (nowDiff > Math.max(timeRangeLength * TIME_LAG_PERCENTAGE_LIMIT, TIME_LAG_MIN_LIMIT)) {
dispatch(
setState({
searchSessionId: data.search.session.start(),
resolvedDateRange: getResolvedDateRange(timefilter),
})
);
}

@flash1293
Copy link
Contributor

@Dosant good find - @lizozom can you reproduce this issue with absolute time ranges as well (no usage of “now”)?

@Dosant
Copy link
Contributor

Dosant commented Feb 1, 2022

@flash1293, absolute time range works. The search takes quite a while to complete.
But compared to the relative time range Lens doesn't trigger refetch when it completes so it doesn't gets stuck in the infinite loop the

@Dosant Dosant changed the title [Production] Lens bsearch never terminates Lens editor gets into infinite search loop when searches take a while to complete and relative time range is used Feb 1, 2022
@Dosant Dosant added Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Feb 1, 2022
@elasticmachine
Copy link
Contributor

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

@Dosant
Copy link
Contributor

Dosant commented Feb 1, 2022

Maybe while fixing this, this would be a good opportunity for lens to add a shard_delay agg, so that it would be easier to test long-running searches in Lens editor. This would also help with functional test

#108201

@flash1293 flash1293 added the impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. label Feb 1, 2022
@lizozom
Copy link
Contributor Author

lizozom commented Feb 1, 2022

@flash1293 @Dosant I think I have another vis where it happens with an absolute timerange.
FYI

image

@Dosant
Copy link
Contributor

Dosant commented Feb 1, 2022

@flash1293 @Dosant I think I have another vis where it happens with an absolute timerange. FYI

In this case, it doesn't look like you even got to the result? (no chart displayed)
So maybe it is just taking its time to complete in elasticsearch?

@lizozom
Copy link
Contributor Author

lizozom commented Feb 1, 2022

Not sure, but the amount of requests seems to be growing larger with time.
It finished! You are correct. It's just incredibly slow

@exalate-issue-sync exalate-issue-sync bot added the loe:small Small Level of Effort label Feb 1, 2022
@flash1293 flash1293 self-assigned this Feb 2, 2022
@flash1293
Copy link
Contributor

flash1293 commented Feb 2, 2022

I misunderstood the bug a bit - the chart is showing up, it's just kicking off a new search immediately as long as the editor is open. It's equivalent to not being able to turn off auto-refresh. This makes this bug way less severe as Lens is constantly sending out requests anyway in most usage scenarios. Changing the severity but still working on a fix.

While at it I will add the shard delay thing to make it easier to debug later on.

@flash1293 flash1293 added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. and removed impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. labels Feb 2, 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:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants