Skip to content
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

fix(stepfunctions-tasks): Default Retry policy for LambdaInvoke does not include Lambda.ClientExecutionTimeoutException default Retry settings #26474

Merged
merged 5 commits into from
Jul 24, 2023

Conversation

tmyoda
Copy link
Contributor

@tmyoda tmyoda commented Jul 22, 2023

According to the document, best practice for Step Functions which invoke a Lambda function is as follows.
https://docs.aws.amazon.com/step-functions/latest/dg/bp-lambda-serviceexception.html

"Retry": [ {
   "ErrorEquals": [ "Lambda.ClientExecutionTimeoutException", "Lambda.ServiceException", "Lambda.AWSLambdaException", "Lambda.SdkClientException"],
   "IntervalSeconds": 2,
   "MaxAttempts": 6,
   "BackoffRate": 2
} ]

I have made changes to align with the official documentation.

Closes #26470.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added bug This issue is a bug. p2 labels Jul 22, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team July 22, 2023 18:01
@github-actions github-actions bot added the beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Jul 22, 2023
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@tmyoda tmyoda changed the title fix(aws-stepfunctions-tasks): Default Retry policy for LambdaInvoke does not include Lambda.ClientExecutionTimeoutException default Retry settings fix(stepfunctions-tasks): Default Retry policy for LambdaInvoke does not include Lambda.ClientExecutionTimeoutException default Retry settings Jul 22, 2023
@tmyoda
Copy link
Contributor Author

tmyoda commented Jul 22, 2023

Exemption Request:

I think the existing test cases integ.invoke.ts and integ.invoke.payload.only.ts are sufficient to test this change.

https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/lambda/integ.invoke.ts

https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/lambda/integ.invoke.payload.only.ts

I have also added the updated results snapshot for these integrated tests.

Clarification Request:

Please let me know if I should add an integ test for this change.

@aws-cdk-automation aws-cdk-automation added pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Jul 22, 2023
@tmokmss
Copy link
Contributor

tmokmss commented Jul 22, 2023

@tmyoda You may want to merge the main branch into this one to trigger the latest PR workflow :)

@aws-cdk-automation aws-cdk-automation added pr/needs-maintainer-review This PR needs a review from a Core Team Member and removed pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Jul 22, 2023
@mrgrain mrgrain added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Jul 24, 2023
@aws-cdk-automation aws-cdk-automation dismissed their stale review July 24, 2023 13:02

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@mrgrain
Copy link
Contributor

mrgrain commented Jul 24, 2023

All good. I'm just running the integ tests and this should be good to go.

@tmyoda
Copy link
Contributor Author

tmyoda commented Jul 24, 2023

@mrgrain

I have already added the updated results snapshot for these integrated tests.

Please let me know if I need to re-run the integ tests.

@mrgrain
Copy link
Contributor

mrgrain commented Jul 24, 2023

@mrgrain

I have already added the updated results snapshot for these integrated tests.

Please let me know if I need to re-run the integ tests.

Apologies, I've made my comment more clear now. There's nothing for you to do right now.

I want run these tests myself and see them deploying. We are having QA problems with integration tests at the moment, completely unrelated to your change. This provides merely an opportunity for me to do a check.

Copy link
Contributor

@mrgrain mrgrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one, thank you!

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 473cdb8
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Jul 24, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit f22bd4e into aws:main Jul 24, 2023
bmoffatt pushed a commit to bmoffatt/aws-cdk that referenced this pull request Jul 29, 2023
…s not include `Lambda.ClientExecutionTimeoutException` default Retry settings (aws#26474)

According to the document,  best practice for Step Functions which invoke a Lambda function is as follows.
https://docs.aws.amazon.com/step-functions/latest/dg/bp-lambda-serviceexception.html
```
"Retry": [ {
   "ErrorEquals": [ "Lambda.ClientExecutionTimeoutException", "Lambda.ServiceException", "Lambda.AWSLambdaException", "Lambda.SdkClientException"],
   "IntervalSeconds": 2,
   "MaxAttempts": 6,
   "BackoffRate": 2
} ]
```

I have made changes to align with the official documentation.

Closes aws#26470.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
schmiddy added a commit to schmiddy/aws-cdk that referenced this pull request May 6, 2024
  aws#26474

to include retry handling for `Lambda.ClientExecutionTimeoutException`, as well.
mergify bot pushed a commit that referenced this pull request May 13, 2024
…ons (#30077)

### Issue # (if applicable)

N/A

### Reason for this change

Doc correction for `retryOnServiceExceptions`.

The code here was updated in #26474 , so that the error `Lambda.ClientExecutionTimeoutException` is handled automatically by [`retryOnServiceExceptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.LambdaInvoke.html#retryonserviceexceptions). However, the documentation comment was not updated to reflect this change.

### Description of changes

Explain that `Lambda.ClientExecutionTimeoutException` is also handled automatically as part of [retryOnServiceExceptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.LambdaInvoke.html#retryonserviceexceptions)

### Description of how you validated changes

N/A

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. p2 pr/needs-maintainer-review This PR needs a review from a Core Team Member pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.
Projects
None yet
4 participants