-
Notifications
You must be signed in to change notification settings - Fork 906
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
Poll for results from frontend for async search #8481
Poll for results from frontend for async search #8481
Conversation
Signed-off-by: Amardeepsingh Siglani <[email protected]>
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, love the changes. Can you also update the SQL search strategy to use this. Right now this change breaks the SQL strategy when querying remote sources like this.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8481 +/- ##
==========================================
- Coverage 60.93% 60.91% -0.02%
==========================================
Files 3760 3761 +1
Lines 89301 89325 +24
Branches 13969 13977 +8
==========================================
+ Hits 54412 54413 +1
- Misses 31493 31516 +23
Partials 3396 3396
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Amardeepsingh Siglani <[email protected]>
Fixed the async sql strategy and also the issue that we see |
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 looks good. Verified that its working. Had one comment that can be a fast follow, but if the query fails while starting the request, it does not follow the same poling response structure.
src/plugins/query_enhancements/server/search/sql_async_search_strategy.ts
Show resolved
Hide resolved
src/plugins/query_enhancements/server/search/sql_async_search_strategy.ts
Show resolved
Hide resolved
* poll for results from frontend for async search Signed-off-by: Amardeepsingh Siglani <[email protected]> * Changeset file for PR #8481 created/updated * fixed async sql strategy; added elapsed time to results Signed-off-by: Amardeepsingh Siglani <[email protected]> * removed unwanted toast notifications Signed-off-by: Amardeepsingh Siglani <[email protected]> --------- Signed-off-by: Amardeepsingh Siglani <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit 58e1645) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* poll for results from frontend for async search * Changeset file for PR #8481 created/updated * fixed async sql strategy; added elapsed time to results * removed unwanted toast notifications --------- (cherry picked from commit 58e1645) Signed-off-by: Amardeepsingh Siglani <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
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.
nice this is helpful
takeWhile((response: FetchStatusResponse) => { | ||
const status = response?.status?.toUpperCase(); | ||
return status !== 'SUCCESS' && status !== 'FAILED'; | ||
}, true), |
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 takeWhile seems unnecessary? since it's anyways take(1)
if a response passes through filter
Description
Currently for async search we depend on the search strategy to start the query and poll for results and resolve once the query completes/fails but since can to the order of 1 to 2 min, the frontend will timeout. This PR adds logic in frontend to poll for the results once the query is started.
The search strategy's search method will be invoked with the query id when polling for results, else it should start search for the given query.
Testing the changes
Tested using local setup and neo app
Changelog
Check List
yarn test:jest
yarn test:jest_integration