-
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
Make action retries configurable #147876
Make action retries configurable #147876
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
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.
LGTM! Verified locally, and works as expected
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
@@ -199,6 +199,22 @@ Specifies the time allowed for requests to external resources. Requests that tak | |||
+ | |||
For example, `20m`, `24h`, `7d`, `1w`. Default: `60s`. | |||
|
|||
`xpack.actions.run.maxAttempts` {ess-icon}:: |
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.
This says that maxAttempts
indicates the number of retries, but when verifying it seems that it means the number of tries. When I set maxAttempts
to 1, I only see the action run once and then not retried, when I would expect it to see it retried 1 time.
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.
I set maxAttempts: 1
and force an email error. After the first action run, I see this log:
[2022-12-21T13:22:25.464-05:00][ERROR][plugins.actions.email] Error: email action error
at Object.executor (/Users/ying/Code/kibana/x-pack/plugins/stack_connectors/server/connector_types/stack/email/index.ts:230:9)
at Object.wrapper [as executor] (/Users/ying/Code/kibana/node_modules/lodash/lodash.js:5255:19)
at /Users/ying/Code/kibana/x-pack/plugins/actions/server/lib/action_executor.ts:154:38
[2022-12-21T13:22:25.464-05:00][WARN ][plugins.actions.email] action execution failure: .email:gmail: email: my gmail: an error occurred while running the action: email action error; retry: true
which says retry: true
. Since maxAttempts is meant to be max retries, I would expect this to be retried once and the logs indicate it will be retried. However, the action task is deleted after this and the action is never retried.
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.
Good catch, @ymao1! We should fix our docs to mention "attempt" instead of "retries". Basically this value confirms how many times an action will run (attempt) before aborting it.
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.
Agreed that the getRetry
/ retry: true
stuff can be confusing 🙈 +1 to a follow up if we didn't break it in this PR.
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.
Yea, I don't think this is caused in this PR. A followup issue is fine
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.
Replaced retry with attempt :)
And checked the retry: true
in the response, action executor returns it when there is an error other than a validation error. I think it means retryable not "the last execution was a retry".
…146222-configurable-retry
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.
LGTM
Resolves: #146222
This PR makes maximum number of retries of an action configurable.
Follows the same pattern we used in alerting plugin.
xpack.actions.run.maxAttempts
as a global settings andxpack.actions.run.connectorTypeOverrides
to override the global settings for specific connector types.