-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Actions are not able to configure a max number of attempts #79169
Comments
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
Moving from |
Should we always be retrying for executor errors instead of relying on the connector type to specify? |
Is that in reference to the Feels like we should leave this in - I guess the code might get a little less complicated if we had some other fixed behavior. Leaving it the way it is would allow us to eventually expose this in the connector type registration, which we don't need right now - and not clear we ever would. It's actually somewhat curious that So, not sure. I guess I'd just as soon leave it in, unless it does actually clean up a bunch of other code, improve performance, ... something. Doesn't seem like it would though. kibana/x-pack/plugins/actions/server/action_type_registry.ts Lines 151 to 165 in c70c4be
|
I think we should definitely be checking for attempts < maxAttempts in kibana/x-pack/plugins/actions/common/types.ts Lines 45 to 52 in aacb083
Do we want to keep that behavior or always retry on these errors? |
Looks like Slack is maybe the only connector that makes use of this - and uses the Date form of the retry (for when it gets 429 response codes). Even though I think this particular retry may be broken right now, seems like we wouldn't be able to do this if we just always retry in these cases. And I suspect there are actually other cases where we would want to use So I think we should continue to allow connector types to pass back the retry info and make use of it. |
The framework allows such configuration but is disregarded due to custom
getRetry
logic that indicates to stop trying after the first attempt.The framework allows action type authors to specify custom retry logic in case they do want the action to run multiple tries when it fails. One way is for the action type to throw an
ExecutorError
type error and specify what to do there (though task manager will still disregard the next run when max attempts is reached). The other way is to setmaxAttempts
in the action type definition and will indicate how many attempts task manager should do. ThegetRetry
returnsfalse
without looking at attempts and maybe that is the fix?Steps to reproduce:
maxAttempts: 3,
herethrow new Error('fail');
here.kibana_task_manager
index and notice the task has status offailed
and attempts of 1 but should have tried two more timesThe text was updated successfully, but these errors were encountered: