Closed ghost closed 2 years ago
Only this application receives a significant number of uploads, so I think it's limited to this and the cove-oc4ids server.
I read https://docs.djangoproject.com/en/4.0/topics/http/file-uploads/#upload-handlers but not much there or on linked pages.
It seems like Django should be deleting the temporary files once they are closed: https://github.com/django/django/blob/main/django/core/files/temp.py
I'll check the CoVE code to see if it's leaving files unclosed (e.g. by leaking file handles).
This comment suggests that the files need to be manually closed: https://stackoverflow.com/a/23657999
However, this comment explains that they are closed when the request is closed: https://stackoverflow.com/a/62357029:
So a few possibilities:
Anyway, that's as much time as I have. We can maybe use tmpreaper
or a simple cron job.
FYI @Bjwebb
Django is not clearing temporary files which has lead to disk space running out. See:
ls -lh /tmp/*.upload*
Possible solutions:
This issue may effect other Django applications so they need checking.