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(cdk): changed retry mechanism for hotswapping AppSync.function #32179

Merged
merged 24 commits into from
Dec 12, 2024

Conversation

ShadowCat567
Copy link
Contributor

@ShadowCat567 ShadowCat567 commented Nov 19, 2024

Reason for this change

Fixing bug in hotswap for AppSync.function where ConcurrentModificationException error continues to appear when attempting hotswap on a large collection of resources.

Description of changes

Switches the retry mechanism for hotswapping AppSync.function from a simple retry where hotswap of AppSync.function is retried 5 times at 1 second intervals if a Concurrent Modification Exception occurs to an exponential back off retry, where the retry interval doubles with each failure.
Exponential backoff will try 6 times (which through my testing should cover all reasonable cases) to resolve AppSync.function hotswap.

Description of how you validated changes

No integration or unit tests added. Passes all current unit tests.
Tested locally on an Amplify project to ensure that cases that previously experienced ConcurrentModificationException errors no longer experienced them.

Checklist


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 p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Nov 19, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team November 19, 2024 00:16
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.

@aws-cdk-automation aws-cdk-automation added the pr/needs-cli-test-run This PR needs CLI tests run against it. label Nov 19, 2024
@ShadowCat567 ShadowCat567 changed the title fix(cdk): Changed retry mechanism for hotswapping AppSync.function fix(cdk): changed retry mechanism for hotswapping AppSync.function Nov 19, 2024
@ShadowCat567 ShadowCat567 marked this pull request as ready for review November 19, 2024 19:28
@ShadowCat567 ShadowCat567 requested a review from a team as a code owner November 22, 2024 23:33
@otaviomacedo
Copy link
Contributor

The code change is correct, but we need at least some unit tests for it.

Copy link

codecov bot commented Dec 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.66%. Comparing base (a73f84b) to head (56e0f44).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #32179      +/-   ##
==========================================
+ Coverage   78.60%   78.66%   +0.05%     
==========================================
  Files         107      107              
  Lines        7161     7161              
  Branches     1320     1320              
==========================================
+ Hits         5629     5633       +4     
+ Misses       1347     1343       -4     
  Partials      185      185              
Flag Coverage Δ
suite.unit 78.66% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk 78.66% <100.00%> (+0.05%) ⬆️

@ShadowCat567
Copy link
Contributor Author

The code change is correct, but we need at least some unit tests for it.

Hi @otaviomacedo, unit tests have been added that should cover the new change. When you have time would you be able to take a look at the updates?

@aws-cdk-automation
Copy link
Collaborator

This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week.

@ShadowCat567
Copy link
Contributor Author

Could this PR receive an Exemption Request? It does not make sense for this code change to include an Integration test change.

@aws-cdk-automation aws-cdk-automation added 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 Dec 11, 2024
@aws-cdk-automation
Copy link
Collaborator

➡️ PR build request submitted to test-main-pipeline ⬅️

A maintainer must now check the pipeline and add the pr-linter/cli-integ-tested label once the pipeline succeeds.

@otaviomacedo otaviomacedo added the pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested label Dec 12, 2024
@aws-cdk-automation aws-cdk-automation removed pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. pr/needs-cli-test-run This PR needs CLI tests run against it. labels Dec 12, 2024
@otaviomacedo otaviomacedo added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Dec 12, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review December 12, 2024 17:02

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

Copy link
Contributor

mergify bot commented Dec 12, 2024

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).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

Copy link
Contributor

mergify bot commented Dec 12, 2024

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 d14d784 into aws:main Dec 12, 2024
16 of 17 checks passed
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 12, 2024
@ShadowCat567 ShadowCat567 deleted the amplify-exp-backoff branch December 12, 2024 17:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested 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
Development

Successfully merging this pull request may close these issues.

4 participants