spring-bootfile-uploadjetty

Jetty tmp Multipart files not being deleted after upload


I have a question regarding the files Jetty temporarily stores in disk during an upload.

As far as I understand, during the upload of some Multipart files, Jetty actually stores in disk these files during the duration of the upload and then the files should be removed automatically from this temporary directory.

My issue is that these files don't ever get deleted, and end up exhausting our free available disk space.

Has anyone encountered anything similar, or have any idea how this could be fixed?

We are using Jetty v12.0.10 provided via SpringBoot.

I know that there are some config properties to define the max size you want to store in mem vs in disk in Spring, like the file-size-threshold (https://docs.spring.io/spring-boot/appendix/application-properties/index.html#application-properties.web.spring.servlet.multipart.file-size-threshold) but I do not think this is the proper solution, since we would be creating other problems.

Thanks!


Solution

  • So when working with Async requests, it seems there was a bug and it will be corrected in version 6.1.12. Have a look here: https://github.com/spring-projects/spring-framework/issues/33161