shotgunsoftware / python-api

A Python-based library for accessing Flow Production Tracking API.
https://developer.shotgridsoftware.com/python-api
Other
306 stars 198 forks source link

Should Uploading to S3 automatically retry when receiving a `HTTP Error 503: Slow Down`? #241

Open Ahuge opened 3 years ago

Ahuge commented 3 years ago

Hey,

Just hit this myself when trying to create a Shotgun PublishedFile and include a thumbnail image with it.

It appears that the sg-media-usor-01 got a bit overloaded with traffic and S3 told us (python api) to slow down.

Because I was naively using the create method to also handle my "image" field, I now get an error after the entity has been created, however I don't know what id the created entity has.

My workaround has been to copy out the upload logic from the create method and wrap it in a retry loop with some sleeping, but it is not ideal.

Is this something that I could propose and get merged in if I wrote a proper implementation for it?

Thanks -Alex

Ahuge commented 3 years ago

Cross posting from the community https://community.shotgunsoftware.com/t/http-error-503-slow-down/11392