fix: exclude DELETE_COMPLETE stacks at API level to prevent ListStack throttling#410
Merged
mollyheamazon merged 1 commit intoaws:mainfrom Apr 16, 2026
Merged
Conversation
nargokul
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The canary account has accumulated 28,000+ DELETE_COMPLETE CloudFormation stacks from repeated test runs.
HpClusterStack.list()was calling ListStacks without a status filter, causing ~280 paginated API calls to retrieve all stacks before filteringDELETE_COMPLETEin Python. This consistently hit CloudFormation's rate limit in the canary environment, causingtest_describe_stack, test_check_status_static_method, and test_status_methods_consistencyto fail with Throttling: Rate exceeded.Fix
Pass
StackStatusFilterto theListStacksAPI call to excludeDELETE_COMPLETEstacks at the source. This reduces the result set from 28k+ entries to only active stacks, eliminating pagination entirely in most cases.Changes
hp_cluster_stack.py: Apply StackStatusFilter with all active statuses when no explicit filter is provided; explicit caller-provided filters are still passed through unchangedtest/unit_tests/cluster_management/test_hp_cluster_stack.py: Updatetest_list_successandtest_list_default_filters_delete_completeto assert API-level filtering; addtest_list_with_explicit_status_filtertest/integration_tests/cluster_management/test_hp_cluster_stack.py: Add assertion that no DELETE_COMPLETE stacks appear in resultsTesting
Verified locally that
list_stacksis called withStackStatusFilterexcludingDELETE_COMPLETE. Unit tests pass. Integ tests will validate against the real account.Reviewer Guidelines
One of the following must be true: