Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to cleanup multipart temp files #27613

Closed
qavid opened this issue Oct 27, 2021 · 2 comments
Closed

Add option to cleanup multipart temp files #27613

qavid opened this issue Oct 27, 2021 · 2 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@qavid
Copy link

qavid commented Oct 27, 2021

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).

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 27, 2021
@poutsma poutsma self-assigned this Oct 27, 2021
@poutsma poutsma added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Oct 27, 2021
@poutsma poutsma added this to the 5.3.13 milestone Nov 2, 2021
@poutsma poutsma added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 2, 2021
@poutsma
Copy link
Contributor

poutsma commented Nov 2, 2021

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 Automatically clean up multipart temp files #27633), we will introduce a way to atomically remove these temporary files after the request is handled.

@poutsma
Copy link
Contributor

poutsma commented Nov 2, 2021

This issue was fixed in 694db22, but the commit message referred to an unrelated issue.

@poutsma poutsma closed this as completed Nov 2, 2021
@poutsma poutsma changed the title Consider adding option to cleanup multipart files stored to a temporary file (Webflux) Add option to cleanup multipart temp files Nov 2, 2021
poutsma added a commit that referenced this issue Nov 3, 2021
This commit moves the Contents abstraction into DefaultParts

See gh-27613
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants