-
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
[TSVB] Cancel discarded searches #125197
[TSVB] Cancel discarded searches #125197
Conversation
094be3e
to
a1517bc
Compare
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
@elasticmachine merge upstream |
Tested and this works fine for me for client-side request aborting, can't test the important here unfortunately (aborting upstream Elasticsearch requests). Noticed one thing, not sure whether it's problematic or not - the server logs this:
@pgayvallet Is the thing from above expected? Also, do you think it's safe to merge this PR without it working or should we wait until this is fixed upstream? |
Not sure, maybe not. But this is coming from the connection from the elasticsearch client (not the client-server connection), so I'm leaning to say that either the request performer is doing something wrong, or there may be a problem inside the Transport's implementation. cc @delvedor do you have any idea how such warnings could be coming from the
Safe, yes, the observable are closed when the request is completed, so it shouldn't lead to any leak. Now if the question is 'can we merge this and assume this will be fixed upstream without requiring us to perform any change?', I don't know. I did an analysis of the problem in #125240, and it's not coming from |
The error is being triggered here: https://github.com/elastic/elastic-transport-js/blob/cebfe9f24e146a150e7b7cc6e76ea6577371ea30/src/connection/HttpConnection.ts#L118-L122 |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@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.
Tested and works as expected. Note for testing - it seems like the base path proxy is not propagating cancelled requests correctly. Running with yarn start --no-base-path
made it work.
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @alexwizp |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Closes: #46353
Summary
When a user issues a search request in a TSVB visualization, we need to cancel it in the following scenarios:
There are two routes in TSVB that must be handled correctly:
/api/metrics/vis/data
🆗 from client -> middleware:
Screen.Recording.2022-02-10.at.12.55.27.PM.mov
/api/metrics/fields
🆗 from client -> middleware:
Screen.Recording.2022-02-10.at.1.00.47.PM.mov
🆗 from middleware -> ElasticSearch.
For those who will test this PR:
If you need to make a delay between
middleware
->ES
you can use run use the following proxykibana should be started with
elasticsearch.hosts: ["http://127.0.0.1:8081"]