Skip to content
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

[Async search Discover] Poll for results when current request completes #8555

Merged
merged 4 commits into from
Oct 18, 2024

Conversation

amsiglan
Copy link
Collaborator

Description

This PR refactors the polling logic for async search in Discover to poll for the query status once the current call resolves.
Currently we fire a polling request every 5 seconds irrespective of whether the previous status check call completed or not.
This will ensure we make fewer polling calls

Screenshot

N/A

Testing the changes

Tested using local setup

Changelog

  • fix: Refactored polling logic to poll for results once current request completes

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

Attention: Patch coverage is 18.18182% with 9 lines in your changes missing coverage. Please review.

Project coverage is 60.96%. Comparing base (615d7d4) to head (15ebeef).
Report is 43 commits behind head on main.

Files with missing lines Patch % Lines
src/plugins/data/common/utils/helpers.ts 18.18% 9 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8555   +/-   ##
=======================================
  Coverage   60.95%   60.96%           
=======================================
  Files        3776     3776           
  Lines       89638    89651   +13     
  Branches    14045    14045           
=======================================
+ Hits        54639    54652   +13     
  Misses      31587    31587           
  Partials     3412     3412           
Flag Coverage Δ
Linux_1 29.12% <18.18%> (+0.04%) ⬆️
Linux_2 56.28% <18.18%> (+<0.01%) ⬆️
Linux_3 37.79% <18.18%> (+0.04%) ⬆️
Linux_4 29.95% <18.18%> (+0.03%) ⬆️
Windows_1 29.14% <18.18%> (+0.04%) ⬆️
Windows_2 56.23% <18.18%> (+<0.01%) ⬆️
Windows_3 37.79% <18.18%> (+0.04%) ⬆️
Windows_4 29.95% <18.18%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
@virajsanghvi virajsanghvi merged commit 6379548 into opensearch-project:main Oct 18, 2024
68 of 70 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 18, 2024
…es (#8555)

* poll for results when current request completes

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* Changeset file for PR #8555 created/updated

* added localization to error string

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* simplified error message for user

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 6379548)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
amsiglan pushed a commit that referenced this pull request Oct 18, 2024
…es (#8555) (#8655)

* poll for results when current request completes



* Changeset file for PR #8555 created/updated

* added localization to error string



* simplified error message for user



---------



(cherry picked from commit 6379548)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
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>
amsiglan added a commit to amsiglan/OpenSearch-Dashboards that referenced this pull request Oct 19, 2024
…es (opensearch-project#8555)

* poll for results when current request completes

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* Changeset file for PR opensearch-project#8555 created/updated

* added localization to error string

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* simplified error message for user

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
sejli pushed a commit to sejli/OpenSearch-Dashboards that referenced this pull request Oct 21, 2024
…es (opensearch-project#8555)

* poll for results when current request completes

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* Changeset file for PR opensearch-project#8555 created/updated

* added localization to error string

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* simplified error message for user

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants