-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Abort cancelled search requests to Elasticsearch #56788
Conversation
Pinging @elastic/kibana-app-arch (Team:AppArch) |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
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.
Code LGTM.
@@ -47,7 +47,7 @@ export const syncSearchStrategyProvider: TSearchStrategyProvider<typeof SYNC_SEA | |||
signal: options.signal, | |||
}); | |||
|
|||
response.then(() => loadingCount$.next(loadingCount$.getValue() - 1)); | |||
response.finally(() => loadingCount$.next(loadingCount$.getValue() - 1)); |
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.
Curious, if this is a bug fix and if there should be a test case for this?
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.
Yes it is and yes there should be.
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.
Added in 159f5f0.
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.
LGTM once green
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* Update abort controller library * Bootstrap * Abort when the request is aborted * Add utility and update value suggestions route * Remove bad merge * Revert switching abort controller libraries * Revert package.json in lib * Move to previous abort controller * Fix test to use fake timers to run debounced handlers * Fix loading bar not going away when cancelling * Add test for loading count * Fix test * Fix failing test Co-authored-by: Elastic Machine <[email protected]>
7.x (7.7.0): b35f969 |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
* Update abort controller library * Bootstrap * Abort when the request is aborted * Add utility and update value suggestions route * Remove bad merge * Revert switching abort controller libraries * Revert package.json in lib * Move to previous abort controller * Fix test to use fake timers to run debounced handlers * Fix loading bar not going away when cancelling * Add test for loading count * Fix test * Fix failing test Co-authored-by: Elastic Machine <[email protected]>
* Abort cancelled search requests to Elasticsearch (#56788) * Update abort controller library * Bootstrap * Abort when the request is aborted * Add utility and update value suggestions route * Remove bad merge * Revert switching abort controller libraries * Revert package.json in lib * Move to previous abort controller * Fix test to use fake timers to run debounced handlers * Fix loading bar not going away when cancelling * Add test for loading count * Fix test * Fix failing test Co-authored-by: Elastic Machine <[email protected]> * Remove unnecessary tests Co-authored-by: Elastic Machine <[email protected]>
Summary
Resolves #55490.
Since the search service and KQL value suggestions were moved to the new platform, there had previously been no way in a route handler to listen for when a request was disconnected. This functionality has since been added. Following this PR, search requests (using the search service or KQL value suggestions) that initiate client-side that are disconnected will now close the upstream connection to Elasticsearch. This signals Elasticsearch to clean up any tasks associated with the originating search request.
Checklist
For maintainers