-
Notifications
You must be signed in to change notification settings - Fork 159
Add multi retryRef to action #681
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
Comments
This is interesting. I think it can be useful to add the retriable error in the retry definition as Amazon States Language does, or it will be difficult to understand the mapping of two arrays. Technically, it will be the same, but it will improve understanding. Can be something like this: {
"actions":[
{
"functionRef":"StorePatient",
"retryRefs":[
"ServicesNotAvailableRetryStrategy",
"NetworkIssue"
]
}
],
"retries":[
{
"name":"ServicesNotAvailableRetryStrategy",
"delay":"PT3S",
"maxAttempts":10,
"errors":[
"ServiceNotAvailable"
]
},
{
"name":"NetworkIssue",
"delay":"PT10S",
"maxAttempts":3,
"errors":[
"ConnectionFailed"
]
}
]
}
|
Currently,the |
I think this would be nice feature to add (even tho possibly very hard to implement). Also if I understand it right it targets idempotent actions where the first error returned determines the retry policy for the remainder of retries, and is not a dynamic retry policy recalculated based on each retry and errors that happened so far (more on that below). Looking at the mentioned AWS samples:
I think this can be implemented already by setting States.Timeout as a non-retryable error.
This is what we are talking about I think. I'd like to know more on how they are handling this when different errors have different maxAttempt values. Think this can run into a number of edge cases that would need to be clearly described. |
Can you give more example on
imo the specification should define how to handing maxAttempt when different errors, like use the value based on error. For example:
|
Yes I updated some text in my answer above (please look again). The retry with this is tied to an error type. In this case we can either assume that if the first invocation raises FlowLimit its retried up to 30 times regardless of errors raised by consequent retries. I think this is doable iff we go with the first assumption (which i think is what aws does too but not sure, let me know if you know). wdyt. |
I don't known how AWS does it, but in my company's workflow engine(base on ASL),it will use the value based on error and record the retry history. For example: the CreateDisk may retry upon 30+ times when error is mixed with FlowLimit & InsufficientResource.
|
Just to add as a general info thing, imo it is an anti-pattern to limit retries via MaxAttempt (outside test scenarios). |
Yep,but MaxAttempt is useful when we want fast-to-fail if we support multi retry strategy. |
I think this really depends on the action timeout (single action execution limit). If you set the action timeout to a large value, and your action is "stuck" for minutes or hours you cannot fail fast even with just 2 retries. The best way to deal with your use cases is to have your actions "heartbeat" meaning report progress and have a heartbeat timeout set to a very small value within which the action has the report its progress/heartbeat. That way if you detect this heartbeat timeout you can fail the action and do your retry fast. This however idk if we can impl in our DSL as not sure we can enforce heartbeating to all runtimes. |
Overall +1 on adding this, just would like to maybe get one or two examples on how this would look like if its done via the mentioned dynamic retry policy calculations on each retry. Thanks! |
Base on the exmaple, we want 3 MaxAttempts and Interval 5s when |
@tsurdilo What's the next step should i do for this?is an PR ok? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
/remove-stale |
/remove stale |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closed as resolved by 1.0.0-alpha1, and therefore as part of #843 |
What would you like to be added:
In current version, there is only one retry strategy can be assign to action:
If a action can reference multi retry strategy it will be useful.
Why is this needed:
The text was updated successfully, but these errors were encountered: