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: Download JS SDKs at once in a single session #3417

Merged
merged 7 commits into from
Nov 7, 2024

Conversation

BYK
Copy link
Member

@BYK BYK commented Nov 7, 2024

Since we download JS SDKs in a for loop which invokes a separate docker container for each curl run, we seem to be triggering some sort of a DoS protection. And rightfully so as the old method causes TCP and TLS churn although we advertise we support HTTP/1.1 and HTTP/2.

This patch does a few things:

  1. Uses curls globbing support to download all files in one go, maxing TCP and TLS reuse. This should fix the DoS protection
  2. Uses curl's --compress option to make things even more efficient
  3. Uses curl's --create-dirs to save 1 docker container run per version for creating the directory
  4. Removes the -I HEAD checks in favor of a -f fail option combined with || true which makes curl fail and not write the output on a non-200 response while still allowing the script to succeed
  5. To make sure the above approach works, it adds a file size test, requiring all downloaded files to be larger than 1kB

@BYK BYK requested a review from aldy505 November 7, 2024 10:27
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.01%. Comparing base (2a7abf2) to head (acb9091).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3417   +/-   ##
=======================================
  Coverage   99.01%   99.01%           
=======================================
  Files           3        3           
  Lines         203      203           
=======================================
  Hits          201      201           
  Misses          2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BYK BYK marked this pull request as ready for review November 7, 2024 11:32
@BYK BYK changed the title fix: Use js.sentry-cdn.com for JS SDK downloads fix: Download JS SDKs at once in a single session Nov 7, 2024
@BYK BYK enabled auto-merge (squash) November 7, 2024 11:42
@BYK BYK disabled auto-merge November 7, 2024 11:42
@BYK BYK enabled auto-merge (squash) November 7, 2024 11:42
Copy link
Collaborator

@aldy505 aldy505 left a comment

Choose a reason for hiding this comment

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

Lets just do this for now.

@BYK BYK merged commit 49e30a7 into master Nov 7, 2024
14 checks passed
@BYK BYK deleted the byk/fix/js-download-flakes branch November 7, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants