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

cloudfront/distribution: Sweeper infinite loop #33675

Merged
merged 2 commits into from
Sep 28, 2023

Conversation

YakDriver
Copy link
Member

@YakDriver YakDriver commented Sep 28, 2023

Description

infiniteloop

Relations

Relates #33663
Relates #33578

References

Output from Acceptance Testing

% make t T='TestAccCloudFrontContinuousDeploymentPolicy_domainChange|TestAccCloudFrontDistribution' K=cloudfront P=8
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/cloudfront/... -v -count 1 -parallel 8 -run='TestAccCloudFrontContinuousDeploymentPolicy_domainChange|TestAccCloudFrontDistribution'  -timeout 360m
=== RUN   TestAccCloudFrontContinuousDeploymentPolicy_domainChange
=== PAUSE TestAccCloudFrontContinuousDeploymentPolicy_domainChange
=== RUN   TestAccCloudFrontDistributionDataSource_basic
=== PAUSE TestAccCloudFrontDistributionDataSource_basic
=== RUN   TestAccCloudFrontDistribution_basic
=== PAUSE TestAccCloudFrontDistribution_basic
=== RUN   TestAccCloudFrontDistribution_disappears
=== PAUSE TestAccCloudFrontDistribution_disappears
=== RUN   TestAccCloudFrontDistribution_tags
=== PAUSE TestAccCloudFrontDistribution_tags
=== RUN   TestAccCloudFrontDistribution_s3Origin
=== PAUSE TestAccCloudFrontDistribution_s3Origin
=== RUN   TestAccCloudFrontDistribution_customOrigin
=== PAUSE TestAccCloudFrontDistribution_customOrigin
=== RUN   TestAccCloudFrontDistribution_originPolicyDefault
=== PAUSE TestAccCloudFrontDistribution_originPolicyDefault
=== RUN   TestAccCloudFrontDistribution_originPolicyOrdered
=== PAUSE TestAccCloudFrontDistribution_originPolicyOrdered
=== RUN   TestAccCloudFrontDistribution_multiOrigin
=== PAUSE TestAccCloudFrontDistribution_multiOrigin
=== RUN   TestAccCloudFrontDistribution_orderedCacheBehavior
=== PAUSE TestAccCloudFrontDistribution_orderedCacheBehavior
=== RUN   TestAccCloudFrontDistribution_orderedCacheBehaviorCachePolicy
=== PAUSE TestAccCloudFrontDistribution_orderedCacheBehaviorCachePolicy
=== RUN   TestAccCloudFrontDistribution_orderedCacheBehaviorResponseHeadersPolicy
=== PAUSE TestAccCloudFrontDistribution_orderedCacheBehaviorResponseHeadersPolicy
=== RUN   TestAccCloudFrontDistribution_forwardedValuesToCachePolicy
=== PAUSE TestAccCloudFrontDistribution_forwardedValuesToCachePolicy
=== RUN   TestAccCloudFrontDistribution_Origin_emptyDomainName
=== PAUSE TestAccCloudFrontDistribution_Origin_emptyDomainName
=== RUN   TestAccCloudFrontDistribution_Origin_emptyOriginID
=== PAUSE TestAccCloudFrontDistribution_Origin_emptyOriginID
=== RUN   TestAccCloudFrontDistribution_Origin_connectionAttempts
=== PAUSE TestAccCloudFrontDistribution_Origin_connectionAttempts
=== RUN   TestAccCloudFrontDistribution_Origin_connectionTimeout
=== PAUSE TestAccCloudFrontDistribution_Origin_connectionTimeout
=== RUN   TestAccCloudFrontDistribution_Origin_originShield
=== PAUSE TestAccCloudFrontDistribution_Origin_originShield
=== RUN   TestAccCloudFrontDistribution_Origin_originAccessControl
=== PAUSE TestAccCloudFrontDistribution_Origin_originAccessControl
=== RUN   TestAccCloudFrontDistribution_noOptionalItems
=== PAUSE TestAccCloudFrontDistribution_noOptionalItems
=== RUN   TestAccCloudFrontDistribution_http11
=== PAUSE TestAccCloudFrontDistribution_http11
=== RUN   TestAccCloudFrontDistribution_isIPV6Enabled
=== PAUSE TestAccCloudFrontDistribution_isIPV6Enabled
=== RUN   TestAccCloudFrontDistribution_noCustomErrorResponse
=== PAUSE TestAccCloudFrontDistribution_noCustomErrorResponse
=== RUN   TestAccCloudFrontDistribution_DefaultCacheBehaviorForwardedValuesCookies_whitelistedNames
=== PAUSE TestAccCloudFrontDistribution_DefaultCacheBehaviorForwardedValuesCookies_whitelistedNames
=== RUN   TestAccCloudFrontDistribution_DefaultCacheBehaviorForwardedValues_headers
=== PAUSE TestAccCloudFrontDistribution_DefaultCacheBehaviorForwardedValues_headers
=== RUN   TestAccCloudFrontDistribution_DefaultCacheBehavior_trustedKeyGroups
=== PAUSE TestAccCloudFrontDistribution_DefaultCacheBehavior_trustedKeyGroups
=== RUN   TestAccCloudFrontDistribution_DefaultCacheBehavior_trustedSigners
=== PAUSE TestAccCloudFrontDistribution_DefaultCacheBehavior_trustedSigners
=== RUN   TestAccCloudFrontDistribution_DefaultCacheBehavior_realtimeLogARN
=== PAUSE TestAccCloudFrontDistribution_DefaultCacheBehavior_realtimeLogARN
=== RUN   TestAccCloudFrontDistribution_OrderedCacheBehavior_realtimeLogARN
=== PAUSE TestAccCloudFrontDistribution_OrderedCacheBehavior_realtimeLogARN
=== RUN   TestAccCloudFrontDistribution_enabled
=== PAUSE TestAccCloudFrontDistribution_enabled
=== RUN   TestAccCloudFrontDistribution_retainOnDelete
=== PAUSE TestAccCloudFrontDistribution_retainOnDelete
=== RUN   TestAccCloudFrontDistribution_OrderedCacheBehaviorForwardedValuesCookies_whitelistedNames
=== PAUSE TestAccCloudFrontDistribution_OrderedCacheBehaviorForwardedValuesCookies_whitelistedNames
=== RUN   TestAccCloudFrontDistribution_OrderedCacheBehaviorForwardedValues_headers
=== PAUSE TestAccCloudFrontDistribution_OrderedCacheBehaviorForwardedValues_headers
=== RUN   TestAccCloudFrontDistribution_ViewerCertificate_acmCertificateARN
=== PAUSE TestAccCloudFrontDistribution_ViewerCertificate_acmCertificateARN
=== RUN   TestAccCloudFrontDistribution_ViewerCertificateACMCertificateARN_conflictsWithCloudFrontDefaultCertificate
=== PAUSE TestAccCloudFrontDistribution_ViewerCertificateACMCertificateARN_conflictsWithCloudFrontDefaultCertificate
=== RUN   TestAccCloudFrontDistribution_waitForDeployment
=== PAUSE TestAccCloudFrontDistribution_waitForDeployment
=== RUN   TestAccCloudFrontDistribution_preconditionFailed
=== PAUSE TestAccCloudFrontDistribution_preconditionFailed
=== RUN   TestAccCloudFrontDistribution_originGroups
=== PAUSE TestAccCloudFrontDistribution_originGroups
=== CONT  TestAccCloudFrontContinuousDeploymentPolicy_domainChange
=== CONT  TestAccCloudFrontDistribution_noOptionalItems
=== CONT  TestAccCloudFrontDistribution_OrderedCacheBehavior_realtimeLogARN
=== CONT  TestAccCloudFrontDistribution_enabled
=== CONT  TestAccCloudFrontDistribution_originGroups
=== CONT  TestAccCloudFrontDistribution_preconditionFailed
=== CONT  TestAccCloudFrontDistribution_waitForDeployment
=== CONT  TestAccCloudFrontDistribution_ViewerCertificateACMCertificateARN_conflictsWithCloudFrontDefaultCertificate
--- PASS: TestAccCloudFrontDistribution_OrderedCacheBehavior_realtimeLogARN (554.57s)
=== CONT  TestAccCloudFrontDistribution_ViewerCertificate_acmCertificateARN
--- PASS: TestAccCloudFrontDistribution_ViewerCertificateACMCertificateARN_conflictsWithCloudFrontDefaultCertificate (569.36s)
=== CONT  TestAccCloudFrontDistribution_OrderedCacheBehaviorForwardedValues_headers
--- PASS: TestAccCloudFrontDistribution_originGroups (1099.61s)
=== CONT  TestAccCloudFrontDistribution_OrderedCacheBehaviorForwardedValuesCookies_whitelistedNames
--- PASS: TestAccCloudFrontDistribution_noOptionalItems (1102.84s)
=== CONT  TestAccCloudFrontDistribution_retainOnDelete
--- PASS: TestAccCloudFrontDistribution_OrderedCacheBehaviorForwardedValues_headers (590.42s)
=== CONT  TestAccCloudFrontDistribution_DefaultCacheBehaviorForwardedValues_headers
--- PASS: TestAccCloudFrontDistribution_waitForDeployment (1170.81s)
=== CONT  TestAccCloudFrontDistribution_DefaultCacheBehavior_realtimeLogARN
--- PASS: TestAccCloudFrontDistribution_ViewerCertificate_acmCertificateARN (618.68s)
=== CONT  TestAccCloudFrontDistribution_DefaultCacheBehavior_trustedSigners
--- PASS: TestAccCloudFrontDistribution_enabled (1621.33s)
=== CONT  TestAccCloudFrontDistribution_DefaultCacheBehavior_trustedKeyGroups
--- PASS: TestAccCloudFrontDistribution_OrderedCacheBehaviorForwardedValuesCookies_whitelistedNames (567.81s)
=== CONT  TestAccCloudFrontDistribution_noCustomErrorResponse
--- PASS: TestAccCloudFrontDistribution_preconditionFailed (1714.15s)
=== CONT  TestAccCloudFrontDistribution_DefaultCacheBehaviorForwardedValuesCookies_whitelistedNames
--- PASS: TestAccCloudFrontDistribution_DefaultCacheBehavior_trustedSigners (542.51s)
=== CONT  TestAccCloudFrontDistribution_orderedCacheBehavior
--- PASS: TestAccCloudFrontDistribution_DefaultCacheBehaviorForwardedValues_headers (589.85s)
=== CONT  TestAccCloudFrontDistribution_isIPV6Enabled
--- PASS: TestAccCloudFrontDistribution_DefaultCacheBehavior_realtimeLogARN (587.64s)
=== CONT  TestAccCloudFrontDistribution_Origin_originAccessControl
--- PASS: TestAccCloudFrontDistribution_DefaultCacheBehavior_trustedKeyGroups (382.06s)
=== CONT  TestAccCloudFrontDistribution_Origin_emptyOriginID
--- PASS: TestAccCloudFrontDistribution_Origin_emptyOriginID (1.47s)
=== CONT  TestAccCloudFrontDistribution_Origin_emptyDomainName
--- PASS: TestAccCloudFrontDistribution_Origin_emptyDomainName (2.08s)
=== CONT  TestAccCloudFrontDistribution_Origin_originShield
--- PASS: TestAccCloudFrontDistribution_retainOnDelete (919.10s)
=== CONT  TestAccCloudFrontDistribution_forwardedValuesToCachePolicy
--- PASS: TestAccCloudFrontDistribution_DefaultCacheBehaviorForwardedValuesCookies_whitelistedNames (323.93s)
=== CONT  TestAccCloudFrontDistribution_orderedCacheBehaviorResponseHeadersPolicy
--- PASS: TestAccCloudFrontDistribution_orderedCacheBehavior (550.95s)
=== CONT  TestAccCloudFrontDistribution_orderedCacheBehaviorCachePolicy
--- PASS: TestAccCloudFrontDistribution_noCustomErrorResponse (600.73s)
=== CONT  TestAccCloudFrontDistribution_http11
--- PASS: TestAccCloudFrontDistribution_isIPV6Enabled (574.70s)
=== CONT  TestAccCloudFrontDistribution_Origin_connectionTimeout
--- PASS: TestAccCloudFrontContinuousDeploymentPolicy_domainChange (2332.77s)
=== CONT  TestAccCloudFrontDistribution_s3Origin
--- PASS: TestAccCloudFrontDistribution_orderedCacheBehaviorResponseHeadersPolicy (532.40s)
=== CONT  TestAccCloudFrontDistribution_multiOrigin
--- PASS: TestAccCloudFrontDistribution_Origin_originAccessControl (813.01s)
=== CONT  TestAccCloudFrontDistribution_originPolicyOrdered
--- PASS: TestAccCloudFrontDistribution_Origin_originShield (564.80s)
=== CONT  TestAccCloudFrontDistribution_originPolicyDefault
--- PASS: TestAccCloudFrontDistribution_orderedCacheBehaviorCachePolicy (491.71s)
=== CONT  TestAccCloudFrontDistribution_customOrigin
--- PASS: TestAccCloudFrontDistribution_forwardedValuesToCachePolicy (829.52s)
=== CONT  TestAccCloudFrontDistribution_basic
--- PASS: TestAccCloudFrontDistribution_http11 (591.28s)
=== CONT  TestAccCloudFrontDistribution_tags
--- PASS: TestAccCloudFrontDistribution_Origin_connectionTimeout (538.43s)
=== CONT  TestAccCloudFrontDistribution_disappears
--- PASS: TestAccCloudFrontDistribution_s3Origin (666.05s)
=== CONT  TestAccCloudFrontDistributionDataSource_basic
--- PASS: TestAccCloudFrontDistribution_originPolicyOrdered (611.41s)
=== CONT  TestAccCloudFrontDistribution_Origin_connectionAttempts
--- PASS: TestAccCloudFrontDistribution_disappears (321.40s)
--- PASS: TestAccCloudFrontDistribution_originPolicyDefault (615.00s)
--- PASS: TestAccCloudFrontDistribution_multiOrigin (617.00s)
--- PASS: TestAccCloudFrontDistribution_basic (343.23s)
--- PASS: TestAccCloudFrontDistribution_tags (373.87s)
--- PASS: TestAccCloudFrontDistributionDataSource_basic (275.47s)
--- PASS: TestAccCloudFrontDistribution_customOrigin (635.95s)
--- PASS: TestAccCloudFrontDistribution_Origin_connectionAttempts (544.80s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront	3730.089s
% echo Sweeping with production/staging set up with continuous deployment
Sweeping with production/staging set up with continuous deployment
% make sweep SWEEPARGS=-sweep-run=aws_cloudfront_distribution
# make sweep SWEEPARGS=-sweep-run=aws_example_thing
# set SWEEPARGS=-sweep-allow-failures to continue after first failure
WARNING: This will destroy infrastructure. Use only in development accounts.
go test ./internal/sweep -v -tags=sweep -sweep=us-west-2,us-east-1,us-east-2,us-west-1 -sweep-run=aws_cloudfront_distribution -timeout 360m
2023/09/28 15:39:45 [DEBUG] Running Sweepers for region (us-west-2):
2023/09/28 15:39:45 [DEBUG] Running Sweeper (aws_cloudfront_distribution) in region (us-west-2)
2023/09/28 15:39:45 [INFO] Sweeping production distributions
2023/09/28 15:39:46 [DEBUG] Waiting for state to become: [success]
2023/09/28 15:39:46 [DEBUG] Waiting for state to become: [Deployed]
2023/09/28 15:40:17 [DEBUG] Waiting for state to become: [Deployed]
2023/09/28 15:40:47 [TRACE] Waiting 15s before next try
2023/09/28 15:41:03 [TRACE] Waiting 10s before next try
2023/09/28 15:41:13 [TRACE] Waiting 10s before next try
2023/09/28 15:41:23 [TRACE] Waiting 10s before next try
2023/09/28 15:41:33 [TRACE] Waiting 10s before next try
2023/09/28 15:41:43 [TRACE] Waiting 10s before next try
2023/09/28 15:41:54 [TRACE] Waiting 10s before next try
2023/09/28 15:42:04 [TRACE] Waiting 10s before next try
2023/09/28 15:42:14 [TRACE] Waiting 10s before next try
2023/09/28 15:42:24 [TRACE] Waiting 10s before next try
2023/09/28 15:42:34 [TRACE] Waiting 10s before next try
2023/09/28 15:42:45 [TRACE] Waiting 10s before next try
2023/09/28 15:42:55 [TRACE] Waiting 10s before next try
2023/09/28 15:43:05 [TRACE] Waiting 10s before next try
2023/09/28 15:43:15 [TRACE] Waiting 10s before next try
2023/09/28 15:43:25 [TRACE] Waiting 10s before next try
2023/09/28 15:43:35 [TRACE] Waiting 10s before next try
2023/09/28 15:43:46 [TRACE] Waiting 10s before next try
2023/09/28 15:43:56 [TRACE] Waiting 10s before next try
2023/09/28 15:44:06 [TRACE] Waiting 10s before next try
2023/09/28 15:44:16 [TRACE] Waiting 10s before next try
2023/09/28 15:44:26 [TRACE] Waiting 10s before next try
2023/09/28 15:44:37 [TRACE] Waiting 10s before next try
2023/09/28 15:44:47 [TRACE] Waiting 10s before next try
2023/09/28 15:44:57 [TRACE] Waiting 10s before next try
2023/09/28 15:45:07 [TRACE] Waiting 10s before next try
2023/09/28 15:45:17 [TRACE] Waiting 10s before next try
2023/09/28 15:45:28 [TRACE] Waiting 10s before next try
2023/09/28 15:45:38 [TRACE] Waiting 10s before next try
2023/09/28 15:45:48 [DEBUG] Waiting for state to become: []
2023/09/28 15:46:03 [INFO] Sweeping continuous deployment policies
2023/09/28 15:46:04 [INFO] Sweeping staging distributions
2023/09/28 15:46:04 [DEBUG] Waiting for state to become: [success]
2023/09/28 15:46:04 [DEBUG] Waiting for state to become: [Deployed]
2023/09/28 15:46:34 [TRACE] Waiting 15s before next try
2023/09/28 15:46:50 [TRACE] Waiting 10s before next try
2023/09/28 15:47:00 [TRACE] Waiting 10s before next try
2023/09/28 15:47:10 [TRACE] Waiting 10s before next try
2023/09/28 15:47:21 [TRACE] Waiting 10s before next try
2023/09/28 15:47:31 [TRACE] Waiting 10s before next try
2023/09/28 15:47:41 [TRACE] Waiting 10s before next try
2023/09/28 15:47:51 [TRACE] Waiting 10s before next try
2023/09/28 15:48:01 [TRACE] Waiting 10s before next try
2023/09/28 15:48:11 [TRACE] Waiting 10s before next try
2023/09/28 15:48:22 [TRACE] Waiting 10s before next try
2023/09/28 15:48:32 [TRACE] Waiting 10s before next try
2023/09/28 15:48:42 [TRACE] Waiting 10s before next try
2023/09/28 15:48:52 [TRACE] Waiting 10s before next try
2023/09/28 15:49:02 [TRACE] Waiting 10s before next try
2023/09/28 15:49:12 [TRACE] Waiting 10s before next try
2023/09/28 15:49:23 [TRACE] Waiting 10s before next try
2023/09/28 15:49:33 [TRACE] Waiting 10s before next try
2023/09/28 15:49:43 [TRACE] Waiting 10s before next try
2023/09/28 15:49:53 [TRACE] Waiting 10s before next try
2023/09/28 15:50:03 [TRACE] Waiting 10s before next try
2023/09/28 15:50:14 [TRACE] Waiting 10s before next try
2023/09/28 15:50:24 [TRACE] Waiting 10s before next try
2023/09/28 15:50:34 [TRACE] Waiting 10s before next try
2023/09/28 15:50:44 [TRACE] Waiting 10s before next try
2023/09/28 15:50:54 [TRACE] Waiting 10s before next try
2023/09/28 15:51:04 [TRACE] Waiting 10s before next try
2023/09/28 15:51:15 [TRACE] Waiting 10s before next try
2023/09/28 15:51:25 [TRACE] Waiting 10s before next try
2023/09/28 15:51:35 [TRACE] Waiting 10s before next try
2023/09/28 15:51:46 [DEBUG] Waiting for state to become: []
2023/09/28 15:52:01 [DEBUG] Completed Sweeper (aws_cloudfront_distribution) in region (us-west-2) in 12m15.867309252s
2023/09/28 15:52:01 Completed Sweepers for region (us-west-2) in 12m15.867535579s
2023/09/28 15:52:01 Sweeper Tests for region (us-west-2) ran successfully:
2023/09/28 15:52:01 	- aws_cloudfront_distribution
2023/09/28 15:52:01 [DEBUG] Running Sweepers for region (us-east-1):
2023/09/28 15:52:01 [DEBUG] Running Sweeper (aws_cloudfront_distribution) in region (us-east-1)
2023/09/28 15:52:01 [INFO] Sweeping production distributions
2023/09/28 15:52:01 [INFO] Sweeping continuous deployment policies
2023/09/28 15:52:01 [INFO] Sweeping staging distributions
2023/09/28 15:52:01 [DEBUG] Completed Sweeper (aws_cloudfront_distribution) in region (us-east-1) in 430.171469ms
2023/09/28 15:52:01 Completed Sweepers for region (us-east-1) in 430.198119ms
2023/09/28 15:52:01 Sweeper Tests for region (us-east-1) ran successfully:
2023/09/28 15:52:01 	- aws_cloudfront_distribution
2023/09/28 15:52:01 [DEBUG] Running Sweepers for region (us-east-2):
2023/09/28 15:52:01 [DEBUG] Running Sweeper (aws_cloudfront_distribution) in region (us-east-2)
2023/09/28 15:52:01 [INFO] Sweeping production distributions
2023/09/28 15:52:01 [INFO] Sweeping continuous deployment policies
2023/09/28 15:52:02 [INFO] Sweeping staging distributions
2023/09/28 15:52:02 [DEBUG] Completed Sweeper (aws_cloudfront_distribution) in region (us-east-2) in 461.374064ms
2023/09/28 15:52:02 Completed Sweepers for region (us-east-2) in 461.399214ms
2023/09/28 15:52:02 Sweeper Tests for region (us-east-2) ran successfully:
2023/09/28 15:52:02 	- aws_cloudfront_distribution
2023/09/28 15:52:02 [DEBUG] Running Sweepers for region (us-west-1):
2023/09/28 15:52:02 [DEBUG] Running Sweeper (aws_cloudfront_distribution) in region (us-west-1)
2023/09/28 15:52:02 [INFO] Sweeping production distributions
2023/09/28 15:52:02 [INFO] Sweeping continuous deployment policies
2023/09/28 15:52:02 [INFO] Sweeping staging distributions
2023/09/28 15:52:02 [DEBUG] Completed Sweeper (aws_cloudfront_distribution) in region (us-west-1) in 705.317116ms
2023/09/28 15:52:02 Completed Sweepers for region (us-west-1) in 705.337591ms
2023/09/28 15:52:02 Sweeper Tests for region (us-west-1) ran successfully:
2023/09/28 15:52:02 	- aws_cloudfront_distribution
ok  	github.com/hashicorp/terraform-provider-aws/internal/sweep	739.173s

@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/XS Managed by automation to categorize the size of a PR. service/cloudfront Issues and PRs that pertain to the cloudfront service. sweeper Pertains to changes to or issues with the sweeper. labels Sep 28, 2023
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 28, 2023
@YakDriver YakDriver force-pushed the b-fix-cloudfront-sweeper-infloop branch from 9e28e0b to 78ff713 Compare September 28, 2023 16:39
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

If a sweeper encounters an error, it should return an error. Otherwise, looks good

Comment on lines 163 to 179
var result *multierror.Error

// sweep:
// 1. Production Distributions
if err := sweepDistributionsByProductionStaging(region, false); err != nil {
result = multierror.Append(result, err)
log.Printf("[WARN] %s", err)
}

// 2. Continuous Deployment Policies
if err := sweepContinuousDeploymentPolicies(region); err != nil {
result = multierror.Append(result, err)
log.Printf("[WARN] %s", err)
}

// 3. Staging Distributions
if err := sweepDistributionsByProductionStaging(region, true); err != nil {
result = multierror.Append(result, err)
log.Printf("[WARN] %s", err)
}

return result.ErrorOrNil()
return nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Errors should return errors, not fail silently

@github-actions github-actions bot added size/M Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Sep 28, 2023
@YakDriver YakDriver merged commit aa50278 into main Sep 28, 2023
41 checks passed
@YakDriver YakDriver deleted the b-fix-cloudfront-sweeper-infloop branch September 28, 2023 19:49
@github-actions github-actions bot added this to the v5.19.0 milestone Sep 28, 2023
github-actions bot pushed a commit that referenced this pull request Sep 28, 2023
@github-actions
Copy link

This functionality has been released in v5.19.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/cloudfront Issues and PRs that pertain to the cloudfront service. size/M Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants