In non-streaming mode, upload of file larger than DefaultPartHttpMessageReader#maxInMemorySize
results in storing uploaded file to a temporrary file. These temporary files are never deleted, if there is no system job/script which is cleaning this temp folder.
We are running our applications on docker images, where the only running process is java and therefore we are running out of space.
Please consider adding option to cleanup (directly or indirectly) uploaded multipart files. Similar option is available in Spring MVC (MultipartResolver#cleanupMultipart
).
Comment From: poutsma
Introducing an option to automatically clean up these files is tricky, and might need several iterations to get right.
Because the 5.3.x branch needs to be stable, we will resolve this issue in two stages:
- In 5.3.13, we will introduce a Part::delete
method that allows you to explicitly remove the files belonging to that part.
- In 6.0 (see #27633), we will introduce a way to atomically remove these temporary files after the request is handled.
Comment From: poutsma
This issue was fixed in 694db2273f24be1152914c9f5bb849a8c0ccbb12, but the commit message referred to an unrelated issue.