We have a Spring WebFlux 5.3.21 application doing multipart file upload. We noticed that sometimes the Part temporary files would not be deleted despite doing part cleanup with FilePart.delete() in our controller. Further investigation revealed that the temporary files are left behind when the clients disconnect before sending the whole file. In that case, the error occurs before the controller is called.

This happens surprisingly often as the clients are mobile devices with spotty cell network connectivity.

Attached is a reproducer for the issue.

early-disconnect-reproducer.zip