Closed Bug 1522435 Opened 6 years ago Closed 6 years ago

Maven metadata generation Lambda function should create CloudFront invalidations

Categories

(Cloud Services :: Operations: Miscellaneous, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: autrilla, Assigned: jlorenzo)

Details

Attachments

(1 file)

:jonalmeida mentioned on Slack that they were seeing different snapshot versions being served to TaskCluster tasks that were running on different regions, namely US east coast and US west coast. Further debugging with https://www.geoscreenshot.com/capture showed that indeed https://snapshots.maven.mozilla.org/maven2/org/mozilla/components/support-ktx/0.40.0-SNAPSHOT/maven-metadata.xml is different in Los Angeles and New Jersey.

I initially thought updating an object in S3 would automatically invalidate that object in CloudFront, but I was wrong and this is actually not the case. We need the Lambda function to create an invalidation in the case where the metadata is being updated and not newly created. Alternatively we could reduce the TTL in CloudFront, but that largely negates the point of using it in the first place.

:jlorenzo, would you be willing to take on the code changes for this? Essentially, we'd need to call https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloudfront.html#CloudFront.Client.create_invalidation. We could pass you the CloudFront distribution ID through an environment variable.

Assignee: nobody → jlorenzo
Status: NEW → ASSIGNED
Attachment #9038812 - Flags: review?(autrilla)

Thanks all for the thorough investigation, Adrian and Jon! I implemented the fix you suggested - and helped me out with -, Adrian. Please let me know what you think of it. The PR can be tested live thanks to https://queue.taskcluster.net/v1/task/CKAlmstFTgWJiOFcHc-Ygg/runs/0/artifacts/public/build/function.zip

Adrian, could you let us when this is deployed to all 4 lambda functions? (If people are wondering, for the context: we have 1 for snapshots, 1 for regular releases and the same ones in staging)

Flags: needinfo?(autrilla)

This has been deployed to all 4 environments. I also submitted a CloudFront invalidation for '/*' to all 4 environments to get rid of the inconsistencies.

Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Flags: needinfo?(autrilla)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: