Description
Dave Hallam opened SPR-11644 and commented
#16040 introduced a change with the intention of preventing the output stream being closed when copying a resource. Unfortunately, the change from FileCopyUtils to StreamUtils has resulted in the resource's input stream not being closed.
see the writeContent() method at https://github.com/spring-projects/spring-framework/blob/master/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java#L254
The result of this is that static resources, e.g. html files that are served up by the application remain locked for a period of time as the inputstream has not been programmatically closed. This prevents the ability to be able to edit static resources (html, css, jsp, etc.), save, and hot deploy as the new versions aren't able to overwrite the locked files.
The other class that was updated by #16040 was ShallowEtagHeaderFilter which is unaffected by this issue as it doesn't involve an input stream.
Affects: 3.2.8, 4.0.2, 4.0.3
Issue Links:
- MarshallingView should avoid temporary byte array when copying to response [SPR-11646] #16269 MarshallingView should avoid temporary byte array when copying to response
Backported to: 3.2.9
1 votes, 4 watchers