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: Retry S3 upload after cloudflare error #9819

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

Dschoordsch
Copy link
Contributor

@Dschoordsch Dschoordsch commented Jun 4, 2024

Description

Fixes #9757
Cloudflare 520 does not give us enough information to know what went wrong on AWS side, so let's just treat it as transient and retry.

Demo

[If possible, please include a screenshot or gif/video, it'll make it easier for reviewers to understand the scope of the changes and how the change is supposed to work. If you're introducing something new or changing the existing patterns, please share a Loom and explain what decisions you've made and under what circumstances]

Testing scenarios

[Please list all the testing scenarios a reviewer has to check before approving the PR]

yarn build
for X in {1..10}; do echo $X; yarn predeploy; done

Final checklist

  • I checked the code review guidelines
  • I have added Metrics Representative as reviewer(s) if my PR invovles metrics/data/analytics related changes
  • I have performed a self-review of my code, the same way I'd do it for any other team member
  • I have tested all cases I listed in the testing scenarios and I haven't found any issues or regressions
  • Whenever I took a non-obvious choice I added a comment explaining why I did it this way
  • I added the label Skip Maintainer Review Indicating the PR only requires reviewer review and can be merged right after it's approved if the PR introduces only minor changes, does not contain any architectural changes or does not introduce any new patterns and I think one review is sufficient'
  • PR title is human readable and could be used in changelog

Cloudflare 520 does not give us enough information to know what went
wrong on AWS side, so let's just treat it as transient and retry.
@github-actions github-actions bot added the size/s label Jun 4, 2024
@Dschoordsch Dschoordsch requested a review from mattkrick June 6, 2024 08:06
@mattkrick
Copy link
Member

This started happening when I upgraded the S3 client. If i had to guess, we could solve this by decreasing the chunkSize from 50 to 25 & seeing what happens.

// @smithy/node-http-handler has a default value of 50 maxSockets
// https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
const chunks = chunk(dirEnts, 50)

@Dschoordsch
Copy link
Contributor Author

Reducing the number of chunks to 25 does not seem to have an effect. Even when set to 1 it shows this error.

@Dschoordsch Dschoordsch merged commit bd37d85 into master Jun 10, 2024
6 checks passed
@Dschoordsch Dschoordsch deleted the fix/9757/retryS3UploadAfterCloudflareError branch June 10, 2024 15:17
@github-actions github-actions bot mentioned this pull request Jun 24, 2024
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pre-Deploy error on Push to CDN
2 participants