You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Temporary files are not deleted if TemporaryFile objects are not garbage collected #5545
Temporary files are not deleted from disk unless the corresponding TemporaryFile objects are garbage collected. When garbage collection is not run in a timely manner, the files accumulate on disk and can lead to a denial of service.
The problem is exacerbated for requests that exceed maxDiskBuffer as handles to the temporary files are never passed to client code, so the client does not have an opportunity to delete the files.
I agree this is a problem, see my comment from here:
…I don't really like the way the delete happens in a finalize method. I'd like us to have a better way of cleaning up resources when a request finishes. Maybe each request could have an object where we could add "request finished" hooks.
I'd rather the user explicitly does something if they want to keep it around after the request is complete, e.g. some sort of acquire/release operation, or maybe moving the file elsewhere.
As discussed in one of the above issues I am assigning the Play 3 milestone.
Activity
richdougherty commentedon Feb 2, 2016
I agree this is a problem, see my comment from here:
wsargent commentedon Feb 2, 2016
Possibly a dup of #5459
mkurz commentedon Mar 6, 2016
Related: #4707, #3913, #6786 and #4762
Also this comment:
As discussed in one of the above issues I am assigning the Play 3 milestone.
wsargent commentedon Jun 23, 2017
This can be handled by enabling the TemporaryFileReaper in 2.6.x: https://www.playframework.com/documentation/2.6.x/ScalaFileUpload#Cleaning-up-temporary-files