-
Notifications
You must be signed in to change notification settings - Fork 76
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
Address search request timeouts as transient error #561
Conversation
Codecov Report
@@ Coverage Diff @@
## main #561 +/- ##
=========================================
Coverage 25.02% 25.02%
Complexity 943 943
=========================================
Files 255 255
Lines 11155 11155
Branches 1250 1250
=========================================
Hits 2791 2791
Misses 8110 8110
Partials 254 254
|
src/main/java/org/opensearch/securityanalytics/logtype/LogTypeService.java
Outdated
Show resolved
Hide resolved
@@ -336,7 +336,7 @@ public void onResponse(IndexResponse response) { | |||
@Override | |||
public void onResponse(SearchResponse response) { | |||
if (response.isTimedOut()) { | |||
onFailures(new OpenSearchStatusException(response.toString(), RestStatus.INTERNAL_SERVER_ERROR)); | |||
onFailures(new OpenSearchStatusException(response.toString(), RestStatus.REQUEST_TIMEOUT)); |
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.
Should we rely on response.toString()
or should we have a more customized error message which can help debug better?
(this comment applies to other code changes as well where we are generating similar timeout errors using response.toString()
)
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.
updated so all errors are consistent with a "Search request timed out" message
Signed-off-by: jowg-amazon <[email protected]>
Signed-off-by: jowg-amazon <[email protected]>
8977bbd
to
389cc2b
Compare
@@ -65,10 +65,10 @@ public void onResponse(BulkByScrollResponse response) { | |||
new OpenSearchStatusException( | |||
String.format( | |||
Locale.getDefault(), | |||
"Correlation Rule with id %s cannot be deleted", | |||
"Search request timed out. Correlation Rule with id %s cannot be deleted", |
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.
Is this a search request?
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.
Changed to "request timed out"
Signed-off-by: jowg-amazon <[email protected]>
@@ -152,7 +152,7 @@ private void onGetResponse(Rule rule) { | |||
@Override | |||
public void onResponse(SearchResponse response) { | |||
if (response.isTimedOut()) { |
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 should be a generic utils method which is invoked mutliple times. else the error message and format wont be consistent
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.
a utils method called handleSearchResponseTimeOut() maybe?
Signed-off-by: jowg-amazon <[email protected]> (cherry picked from commit 3aa2844)
Signed-off-by: jowg-amazon <[email protected]> (cherry picked from commit 3aa2844)
Signed-off-by: jowg-amazon <[email protected]> (cherry picked from commit 3aa2844) Co-authored-by: Joanne Wang <[email protected]>
Signed-off-by: jowg-amazon <[email protected]> (cherry picked from commit 3aa2844) Co-authored-by: Joanne Wang <[email protected]>
* passing props for date time filter (opensearch-project#551) Signed-off-by: Amardeepsingh Siglani <[email protected]> * added loading state Signed-off-by: Amardeepsingh Siglani <[email protected]> * ux improvements Signed-off-by: Amardeepsingh Siglani <[email protected]> * transform vega-lite files for jest testing Signed-off-by: Amardeepsingh Siglani <[email protected]> --------- Signed-off-by: Amardeepsingh Siglani <[email protected]>
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.9 2.9
# Navigate to the new working tree
cd .worktrees/backport-2.9
# Create a new branch
git switch --create backport/backport-561-to-2.9
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 3aa28448a05aee7001323065ad06606acdb7383d
# Push it to GitHub
git push --set-upstream origin backport/backport-561-to-2.9
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.9 Then, create a pull request where the |
Description
Change rest status on search request timeouts to be a transient error:
REQUEST_TIMEOUT
Issues Resolved
#502
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.