-
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,7 +152,7 @@ | |
@Override | ||
public void onResponse(SearchResponse response) { | ||
if (response.isTimedOut()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. a utils method called handleSearchResponseTimeOut() maybe? |
||
onFailures(new OpenSearchStatusException(String.format(Locale.getDefault(), "Rule with id %s cannot be deleted", rule.getId()), RestStatus.INTERNAL_SERVER_ERROR)); | ||
onFailures(new OpenSearchStatusException(String.format(Locale.getDefault(), "Search request timed out. Rule with id %s cannot be deleted", rule.getId()), RestStatus.REQUEST_TIMEOUT)); | ||
Check warning on line 155 in src/main/java/org/opensearch/securityanalytics/transport/TransportDeleteRuleAction.java Codecov / codecov/patchsrc/main/java/org/opensearch/securityanalytics/transport/TransportDeleteRuleAction.java#L155
|
||
return; | ||
} | ||
|
||
|
@@ -231,7 +231,7 @@ | |
@Override | ||
public void onResponse(BulkByScrollResponse response) { | ||
if (response.isTimedOut()) { | ||
onFailures(new OpenSearchStatusException(String.format(Locale.getDefault(), "Rule with id %s cannot be deleted", ruleId), RestStatus.INTERNAL_SERVER_ERROR)); | ||
onFailures(new OpenSearchStatusException(String.format(Locale.getDefault(), "Search request timed out. Rule with id %s cannot be deleted", ruleId), RestStatus.REQUEST_TIMEOUT)); | ||
Check warning on line 234 in src/main/java/org/opensearch/securityanalytics/transport/TransportDeleteRuleAction.java Codecov / codecov/patchsrc/main/java/org/opensearch/securityanalytics/transport/TransportDeleteRuleAction.java#L234
|
||
return; | ||
} | ||
|
||
|
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"