ImperialCollegeLondon / django-drf-filepond

A Django app providing a server implemention for the Filepond file upload library
BSD 3-Clause "New" or "Revised" License
103 stars 39 forks source link

Issue with crashes when using multiple gunicorn workers due to temp directory creation #104

Closed jcohen02 closed 6 months ago

jcohen02 commented 6 months ago

An issue has been reported in #96 that crashes are experienced when running multiple gunicorn workers as a result of the attempt to create the temporary directory defined by DJANGO_DRF_FILEPOND_UPLOAD_TMP.

Despite the check for existence of the directory appearing right before the attempt to create the directory, it's assumed that this must be the result of a race condition where workers starting at the same time pass the check for the directory not existing and then one of the workers successfully creates the directory with the others failing because it now exists. This has not been investigated in more detail but the proposed fix of adding exist_ok=True to the os.makedirs call seems like a reasonable solution to address this.