Closed Uxio0 closed 2 years ago
This is great! I'll get this merged ASAP.
Nice! Thank you for all the work!
Any chance of some more info on the original issue? What does "s3 operations were breaking if using threading" mean exactly?
I came across this due to the django-storages changelog, but we've been using gunicorn with --worker-class=gevent
and uploading via boto3 for years, and AFAIK haven't had any issues. So I'd appreciate any more info you can add.
Any chance of some more info on the original issue? What does "s3 operations were breaking if using threading" mean exactly?
I came across this due to the django-storages changelog, but we've been using gunicorn with
--worker-class=gevent
and uploading via boto3 for years, and AFAIK haven't had any issues. So I'd appreciate any more info you can add.
That's not our experience at all (using Gunicorn + gevent too, last versions at that time). Gunicorn was breaking silently and a 500 was returned when we tried to upload a image to Django admin. We tracked the issue to this configuration variable.
Good thing is that this PR only gives you more control, so by default you will be using default config. I'm really curious on why it works for you and not for us.
@craigds are you doing something special for monkey patching or just relaying on the default gunicorn patching?
@craigds this would be the reason, as they use concurrent.futures.ThreadPoolExecutor
(https://github.com/boto/s3transfer/blob/develop/s3transfer/futures.py#L407):
http://www.gevent.org/api/gevent.monkey.html#gevent.monkey.patch_thread
When using
gevent
, s3 operations were breaking if using threading. Allow to disable it addingAWS_S3_USE_THREADS
configuration flag