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(manager): screenshot upload concurrency limit (DT-1532) #1191

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

lihbr
Copy link
Member

@lihbr lihbr commented Oct 25, 2023

Context

Network can be overloaded when pushing too many screenshots at once.

Fixes: DT-1532

The Solution

This PR limits the concurrency rate at which screenshots can be pushed to 10 (at the same time). This means that if you need to push 12 screenshots it will first work on uploading the 10 first, then as soon as one is finished will pick the 11th, and then the 12th, never uploading more than 10 screenshots at the same time.

How to QA

It's a bit hard to QA, here's a test archive containing 14 slices, each with 14 variations, each featuring a unique 5-to-10MB screenshot (so it's 196 slices, worth about 1.3GB of screenshots to upload): https://drive.google.com/file/d/1jK-WExrxMklGmCJ8KXHz-iFz74_9ZXaI/view?usp=sharing

Once you have them, set them up in a Slice Machine project, and try running the init command. It's easier to reproduce the previous issue by running off a mobile hotspot in order to have a flakier internet (because direct link fiber connection was nailing it on my end)

Impact / Dependencies

/

Checklist before requesting a review

  • I hereby declare my code ready for review.
  • If it is a critical feature, I have added tests.
  • The CI is successful.
  • If there could backward compatibility issues, it has been discussed and planned.

@linear
Copy link

linear bot commented Oct 25, 2023

DT-1532 Unable to Push Slices and Custom Type: 400

Versions

  • slice-machine-ui:"^1.5.2"
  • node:18.17.0

Reproduction

The user is trying to push several custom types and slices changes to prismic using the slice machine. However, every time we click on the "Push to Prismic" button they get the following error on the console:

image

https://community.prismic.io/t/unable-to-upload-screenshot-with-status-code-400/13711

Steps to reproduce

I won't be able to reproduce the issue on my local.

https://github.com/prismicio/slice-machine/issues/107

Sentry logs: https://prismicio.sentry.io/issues/4336459685/events/?project=4504179268845568&referrer=issue-stream&sort=release&statsPeriod=14d&stream_index=0

@vercel
Copy link

vercel bot commented Oct 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
slice-machine ✅ Ready (Inspect) Visit Preview Oct 25, 2023 11:41am

@lihbr lihbr merged commit 4c10ae3 into dev-next-release Oct 25, 2023
@lihbr lihbr deleted the lh/fix-screenshot-upload-concurrency-limit branch October 25, 2023 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants