[Reporting/CSV] Do not fail the job if scroll ID can not be cleared#76014
Merged
tsullivan merged 3 commits intoelastic:masterfrom Sep 1, 2020
Merged
[Reporting/CSV] Do not fail the job if scroll ID can not be cleared#76014tsullivan merged 3 commits intoelastic:masterfrom
tsullivan merged 3 commits intoelastic:masterfrom
Conversation
Contributor
|
Pinging @elastic/kibana-reporting-services (Team:Reporting Services) |
Member
Author
|
@elasticmachine merge upstream |
Member
Author
|
@elasticmachine Merge upstream |
Member
Author
|
@elasticmachine merge upstream |
Contributor
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
| return callEndpoint('clearScroll', { | ||
| scrollId: [scrollId], | ||
| }); | ||
| try { |
Contributor
There was a problem hiding this comment.
Should we wrap these in a try/catch, or do:
return callEndpoint('clearScroll', { scrollId: [scrollId] }).catch((err) => {
// Do not throw the error, as the job can still be completed successfully
logger.warn('Scroll context can not be cleared!');
logger.error(err);
});
Contributor
There was a problem hiding this comment.
Just a matter of code/preference. The .catch is a bit more concise whereas the try/catch is more idiomatic async/await js
Member
Author
There was a problem hiding this comment.
It definitely could go either way, in which case I like to defer to the existing async style in other code in the file. In this case, async/await follows the code style in this file
joelgriffith
approved these changes
Aug 31, 2020
Member
Author
|
Thank @joelgriffith ! |
tsullivan
added a commit
to tsullivan/kibana
that referenced
this pull request
Sep 1, 2020
…lastic#76014) Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris
added a commit
to gmmorris/kibana
that referenced
this pull request
Sep 2, 2020
* master: (223 commits) skip flaky suite (elastic#75724) [Reporting] Add functional test for Reports in non-default spaces (elastic#76053) [Enterprise Search] Fix various icons in dark mode (elastic#76430) skip flaky suite (elastic#76245) Add `auto` interval to histogram AggConfig (elastic#76001) [Resolver] generator uses setup_node_env (elastic#76422) [Ingest Manager] Support both zip & tar archives from Registry (elastic#76197) [Ingest Manager] Improve agent vs kibana version checks (elastic#76238) Manually building `KueryNode` for Fleet's routes (elastic#75693) remove dupe tinymath section (elastic#76093) Create APM issue template (elastic#76362) Delete unused file. (elastic#76386) [SECURITY_SOLUTION][ENDPOINT] Trusted Apps Create API (elastic#76178) [Detections Engine] Add Alert actions to the Timeline (elastic#73228) [Dashboard First] Library Notification (elastic#76122) [Maps] Add mvt support for ES doc sources (elastic#75698) Add setHeaderActionMenu API to AppMountParameters (elastic#75422) [ML] Remove "Are you sure" from data frame analytics jobs (elastic#76214) [yarn] remove typings-tester, use @ts-expect-error (elastic#76341) [Reporting/CSV] Do not fail the job if scroll ID can not be cleared (elastic#76014) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #75594
Release note:
This PR avoids failing the CSV Reporting job if the call to clear the scroll fails. At that point, the CSV content has already been generated and is ready for export.
Reasons why Elasticsearch returns a 404 when called to clear a scroll:
If Elasticsearch can not find an active search context, it will return a 404 Not Found HTTP status code.
Checklist
Delete any items that are not applicable to this PR.
For maintainers