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(DBCluster): Handle delete handler stabilization when dbcluster listempty #567

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

angusy29
Copy link
Contributor

@angusy29 angusy29 commented Sep 3, 2024

Description of changes:

When a user deletes their DBCluster, the DBCluster is first deleted via DeleteDbCluster.
The handler then runs stabilization, where it calls describeDbCluster.

When the describeDbCluster occurs right after DeleteDbCluster, the DescibeDbCluster call can return an empty DbClusters list instead of a DBClusterNotFoundException, and this causes the DeleteHandler to fail.

If the user re-attempts a stack deletion, the second try of stack deletion will succeed, because the DescribeDbCluster call will throw a DBClusterNotFoundException.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@@ -401,7 +401,7 @@ protected boolean isDBClusterDeleted(
) {
try {
fetchDBCluster(proxyClient, model);
} catch (DbClusterNotFoundException e) {
} catch (DbClusterNotFoundException | IndexOutOfBoundsException e) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about making this catch at fetchDBCluster (further up the call stack), but isDBClusterDeleted is only called in 1 callsite and contains the blast radius to just the DeleteHandler.

ccmlst
ccmlst previously approved these changes Sep 4, 2024
@zrfr zrfr added this pull request to the merge queue Sep 4, 2024
Merged via the queue into aws-cloudformation:master with commit a4a70a6 Sep 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants