forked from opensearch-project/ml-commons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementing retry for remote connector to mitigate throttling issue (o…
…pensearch-project#2462) * use retryable action; execution context Signed-off-by: zhichao-aws <[email protected]> * change to groupedActionListener Signed-off-by: zhichao-aws <[email protected]> * fix group Signed-off-by: zhichao-aws <[email protected]> * retry policy Signed-off-by: zhichao-aws <[email protected]> * base time Signed-off-by: zhichao-aws <[email protected]> * retry option, cluster settings Signed-off-by: zhichao-aws <[email protected]> * nit Signed-off-by: zhichao-aws <[email protected]> * lint Signed-off-by: zhichao-aws <[email protected]> * change interface to class Signed-off-by: zhichao-aws <[email protected]> * fix ut due to code change Signed-off-by: zhichao-aws <[email protected]> * license header Signed-off-by: zhichao-aws <[email protected]> * add ut Signed-off-by: zhichao-aws <[email protected]> * add test Signed-off-by: zhichao-aws <[email protected]> * fix core interface Signed-off-by: zhichao-aws <[email protected]> * test Signed-off-by: zhichao-aws <[email protected]> * license header Signed-off-by: zhichao-aws <[email protected]> * use exception holder Signed-off-by: zhichao-aws <[email protected]> * add max retry times settings Signed-off-by: zhichao-aws <[email protected]> * fix typo Signed-off-by: zhichao-aws <[email protected]> * nit Signed-off-by: zhichao-aws <[email protected]> * change the order to avoid misleading log Signed-off-by: zhichao-aws <[email protected]> * license header Signed-off-by: zhichao-aws <[email protected]> * move settings to connector Signed-off-by: zhichao-aws <[email protected]> * remove settings Signed-off-by: zhichao-aws <[email protected]> * add test Signed-off-by: zhichao-aws <[email protected]> * add retry_backoff_policy setting Signed-off-by: zhichao-aws <[email protected]> * changes for comments Signed-off-by: zhichao-aws <[email protected]> * fix retry times Signed-off-by: zhichao-aws <[email protected]> * make the error handling more neat in MLSdkAsyncHttpResponseHandler Signed-off-by: zhichao-aws <[email protected]> * change to SageMakerThrottlingException Signed-off-by: zhichao-aws <[email protected]> * use enum for retry backoff policy Signed-off-by: zhichao-aws <[email protected]> * fix seconds to milliseconds in equal jitter policy Signed-off-by: zhichao-aws <[email protected]> * disable retry by default Signed-off-by: zhichao-aws <[email protected]> --------- Signed-off-by: zhichao-aws <[email protected]>
- Loading branch information
1 parent
865a424
commit 399825f
Showing
19 changed files
with
940 additions
and
441 deletions.
There are no files selected for viewing
This file contains 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
22 changes: 22 additions & 0 deletions
22
common/src/main/java/org/opensearch/ml/common/connector/RetryBackoffPolicy.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.ml.common.connector; | ||
|
||
import java.util.Locale; | ||
|
||
public enum RetryBackoffPolicy { | ||
CONSTANT, | ||
EXPONENTIAL_EQUAL_JITTER, | ||
EXPONENTIAL_FULL_JITTER; | ||
|
||
public static RetryBackoffPolicy from(String value) { | ||
try { | ||
return RetryBackoffPolicy.valueOf(value.toUpperCase(Locale.ROOT)); | ||
} catch (Exception e) { | ||
throw new IllegalArgumentException("Unsupported retry backoff policy"); | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.