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

ScriptTemplateView should close the template InputStream [SPR-13445] #18025

Closed
spring-projects-issues opened this issue Sep 8, 2015 · 3 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Sébastien Deleuze opened SPR-13445 and commented

Running some benchmarks on spring-boot-sample-web-handlebars demo application then running lsof command line tool shows a lot of template files opened.

ScriptTemplateView#getTemplate() should close the template InputStream properly, since according to its Javadoc, StreamUtils#copyToString leaves the stream open when done.


Affects: 4.2.1

Referenced from: commits ff02ad4

@spring-projects-issues
Copy link
Collaborator Author

Sébastien Deleuze commented

This commit (not yet merged in master) fixes the issue

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Sébastien Deleuze, you could also FileCopyUtils.copyToString there, since that one does close the stream eventually. StreamUtils has been introduced as a kind of mirror class that explicitly does not close the stream for each of the operations.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Sébastien Deleuze commented

Indeed, thanks for your feedback!

@spring-projects-issues spring-projects-issues added type: bug A general bug in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.2.2 milestone Jan 11, 2019
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: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants