Skip to content

Close Body after reading #25897

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

Closed

Conversation

SenseiFisher
Copy link

readWithMessageConverters opens a FileInputStream but does not ensure it closes after reading from it.
Ensure the FileInputStream is closed.

Solves Issue:
#25896

readWithMessageConverters opens a FileInputStream but does not ensure it closes after reading from it.
Ensure the FileInputStream is closed.
@pivotal-issuemaster
Copy link

@SenseiFisher Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@SenseiFisher Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 12, 2020
@rstoyanchev
Copy link
Contributor

I don't think it should be closed as it may not be the end of the response, for example in a multipart request but it could also be in another streaming scenario. See for example #14728 or the more recent regression #25989 caused by a similar fix.

Is there a specific issue that this presents?

@rstoyanchev rstoyanchev added status: waiting-for-feedback We need additional information before we can continue in: web Issues in web modules (web, webmvc, webflux, websocket) labels Nov 2, 2020
@SenseiFisher
Copy link
Author

SenseiFisher commented Nov 29, 2020 via email

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Nov 29, 2020
@jhoeller
Copy link
Contributor

jhoeller commented Dec 1, 2020

Since this is on the input side, we could potentially close it once the request body has been fully read. I'm less concerned there than on the output side but still wondering why it would be necessary.

Where does the FileInputStream come from, actually? Is it Tomcat opening such a stream?

@SenseiFisher
Copy link
Author

SenseiFisher commented Dec 3, 2020 via email

@rstoyanchev rstoyanchev self-assigned this Dec 15, 2021
@rstoyanchev rstoyanchev added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on status: feedback-provided Feedback has been provided labels Dec 15, 2021
@rstoyanchev
Copy link
Contributor

rstoyanchev commented Dec 15, 2021

Scheduling for consideration in 6.0 M2 along with #27773.

Where does the FileInputStream come from, actually? Is it Tomcat opening such a stream?

If it is related to reading parts, as in #27773, then the the underlying input stream could be a temp file for the part.

@rstoyanchev rstoyanchev added this to the 6.0 M2 milestone Dec 15, 2021
@rstoyanchev rstoyanchev removed this from the 6.0.0-M2 milestone Jan 11, 2022
@rstoyanchev rstoyanchev added the status: superseded An issue that has been superseded by another label Jan 11, 2022
@rstoyanchev
Copy link
Contributor

We're going to address this in a similar way but with a slightly different implementation, so I'm closing this as superseded by #27773.

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) status: superseded An issue that has been superseded by another type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants