-
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
[data.search.bsearch] Forward request abortSignal to search strategy #170041
Conversation
…lastic#169041) ## Summary Creates an `abortSignal` from the request disconnected event that is forwarded to the search strategy. In practice this means that when a bsearch call is disconnected (either due to client disconnect or server timeout) the corresponding call to ES is also cancelled. ### Checklist Delete any items that are not applicable to this PR. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) --------- Co-authored-by: Stratoula Kalafateli <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts
Outdated
Show resolved
Hide resolved
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
@elasticmachine merge upstream |
src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts
Show resolved
Hide resolved
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.
Discovery owns search.
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 left some feedback in the comments, but overall the changes seem good. My only other question is are we able to add functional test coverage for these changes, especially around the scenario that led to the crashes in CI? Maybe through API integration tests or similar?
src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts
Show resolved
Hide resolved
src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts
Outdated
Show resolved
Hide resolved
src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts
Show resolved
Hide resolved
src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.test.ts
Show resolved
Hide resolved
…to bsearch/abort-again
Added in 7fc746a |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
History
To update your PR or re-run it, just comment with: cc @lukasolson |
Should be ready for another look. |
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.
Thanks for all the work on this, and especially all the tests! The integration test looks like it does a good job covering the issue we were running into. For good measure I started a flaky test run on some of the FTR configs that were failing last time and the config for the new integration test: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3966.
I'm going to approve now though since it LGTM, and I think we should be good to merge as long as the test runs pass 👍
src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts
Show resolved
Hide resolved
## Summary Resolves #168957. It turns out the underlying issue was resolved in #170041 (unhandled errors when deleting not being handled). However this still left it up to consumers of `pollSearch` to be 100% sure they weren't leaking unhandled promise rejections. This adds code directly to `pollSearch` that will handle rejections if they aren't handled in the calling code. It also adds tests to consumers of `pollSearch` to make sure they don't barf in the case that the `cancel` function errors. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
Summary
Attempt to resurrect #169041.
Previously flaky tests:
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers