-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[ML] Return 429 status when RequestExecutorService queue full #134178
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
Changes from all commits
05a2fe0
82104aa
7d5059c
ade8984
9538bb4
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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pr: 134178 | ||
| summary: Return 429 status when `RequestExecutorService` queue full | ||
| area: Machine Learning | ||
| type: bug | ||
| issues: [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,6 @@ | |
|
|
||
| import org.apache.logging.log4j.LogManager; | ||
| import org.apache.logging.log4j.Logger; | ||
| import org.elasticsearch.ElasticsearchException; | ||
| import org.elasticsearch.ElasticsearchStatusException; | ||
| import org.elasticsearch.action.ActionListener; | ||
| import org.elasticsearch.core.TimeValue; | ||
|
|
@@ -27,7 +26,6 @@ | |
| import java.util.Objects; | ||
|
|
||
| import static org.elasticsearch.xpack.inference.external.action.ActionUtils.constructFailedToSendRequestMessage; | ||
| import static org.elasticsearch.xpack.inference.external.action.ActionUtils.createInternalServerError; | ||
| import static org.elasticsearch.xpack.inference.external.action.ActionUtils.wrapFailuresInElasticsearchException; | ||
|
|
||
| public class AlibabaCloudSearchCompletionAction implements ExecutableAction { | ||
|
|
@@ -61,16 +59,14 @@ public void execute(InferenceInputs inferenceInputs, TimeValue timeout, ActionLi | |
| return; | ||
| } | ||
|
|
||
| ActionListener<InferenceServiceResults> wrappedListener = wrapFailuresInElasticsearchException( | ||
|
Member
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. These Alibaba classes are the outlier everything else is done by
Contributor
Author
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. I'll fix this in another PR, since it's pretty far out of scope for this one. |
||
| failedToSendRequestErrorMessage, | ||
| listener | ||
| ); | ||
| try { | ||
| ActionListener<InferenceServiceResults> wrappedListener = wrapFailuresInElasticsearchException( | ||
| failedToSendRequestErrorMessage, | ||
| listener | ||
| ); | ||
| sender.send(requestCreator, inferenceInputs, timeout, wrappedListener); | ||
| } catch (ElasticsearchException e) { | ||
| listener.onFailure(e); | ||
| } catch (Exception e) { | ||
| listener.onFailure(createInternalServerError(e, failedToSendRequestErrorMessage)); | ||
| wrappedListener.onFailure(e); | ||
| } | ||
| } | ||
| } | ||
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.
👍 that's a neat solution