-
Couldn't load subscription status.
- Fork 4.3k
Closed
DataDog/serverless-sample-app
#499Labels
@aws-cdk/aws-cloudfrontRelated to Amazon CloudFrontRelated to Amazon CloudFront@aws-cdk/aws-s3-deploymentbugThis issue is a bug.This issue is a bug.p1
Description
aws-cdk/packages/@aws-cdk/aws-s3-deployment/lib/lambda/index.py
Lines 150 to 163 in beb01b5
| def cloudfront_invalidate(distribution_id, distribution_paths): | |
| invalidation_resp = cloudfront.create_invalidation( | |
| DistributionId=distribution_id, | |
| InvalidationBatch={ | |
| 'Paths': { | |
| 'Quantity': len(distribution_paths), | |
| 'Items': distribution_paths | |
| }, | |
| 'CallerReference': str(uuid4()), | |
| }) | |
| # by default, will wait up to 10 minutes | |
| cloudfront.get_waiter('invalidation_completed').wait( | |
| DistributionId=distribution_id, | |
| Id=invalidation_resp['Invalidation']['Id']) |
I've come across a deployment where cloudfront was invalidated but the lambda timed out with cfn_error: Waiter InvalidationCompleted failed: Max attempts exceeded. I suspect a race conditon, and that reversing the order of cloudfront.create_invalidation() and cloudfront.get_waiter() would fix this race condition.
edit: proposed fix of reversing create_invalidation() and get_waiter() is invalid, see #15891 (comment)
flochaz, sebastian-fredriksson-bernholtz, DarshanAwachat, ann8ty, Brody8TY and 24 more
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-cloudfrontRelated to Amazon CloudFrontRelated to Amazon CloudFront@aws-cdk/aws-s3-deploymentbugThis issue is a bug.This issue is a bug.p1