-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Background search] Change polling behavior #244760
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
base: main
Are you sure you want to change the base?
Conversation
|
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
lukasolson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still want to poll until all pending search requests are completed, otherwise we can get into a situation like this: A dashboard with two panels, one with a search request that takes 5 seconds, another that takes 10 minutes. The first completes after 5s, but doesn't continue polling. After 1 minute of not polling, this gets cleaned up and so if we send to background afterwards, there will be errors.
In practice this doesn't seem to actually happen (from my tests), and I think it's because ES actually only cleans up completed searches every hour. But I think it's still better to be safe than rely on an undocumented behavior in ES.
What are your thoughts?
that sounds good, i'll update to keep the polling until everything has finished in the search session |
|
|
||
| const schedulePollSearches = () => { | ||
| return timer(KEEP_ALIVE_COMPLETED_SEARCHES_INTERVAL).pipe( | ||
| return interval(KEEP_ALIVE_COMPLETED_SEARCHES_INTERVAL).pipe( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've changed it from timer + repeat to just use interval
| takeUntil(this.disableSaveAfterSearchesExpire$.pipe(filter((disable) => disable))), | ||
| takeUntil(stopOnFinishedState$) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the main change, now on top of the existing behavior we stop when the search session is in a completed status
💚 Build Succeeded
Metrics [docs]Page load bundle
History
cc @AlexGPlay |
Summary
Closes #230909
Right now after a search has finished we keep polling it every 30 seconds, this was because search sessions allowed to save them after they finished, but with background search that's not the case, so we don't need to poll.
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:*label is applied per the guidelinesbackport:*labels.