Python SDK creating hung urllib connections in connectionpool
I have a django-based app for which I have written a custom storage backend for file uploads based on the Box Python SDK. Generally the custom storage behaves as expected, but a big failure case occurs when attempting to upload a file "implicitly" using django's form system, which attaches the browser file upload field contents to a data model, then "saves" that model. The "save" part calls my custom storage "save" method which attempts to do a file upload with preflight check to the Box API. I don't get much information from debugging - all I can see is that I get a number of new connection attempts to the "update" endpoint filling up the urllib3.connectionpool instance and no responses coming back from Box. I'm not sure if anyone here knows what about django's modelforms might be causing this behavior? I'm not getting errors from Box when this happens, just hung connections. Further attempts to submit the form just create more hung connections in the connection pool. If I simply persist a model instance directly without a form involved, the file field in the model seems to persist to Box storage just fine.
Please sign in to leave a comment.
Comments
0 comments