Affects: Spring MVC 5.2.13


I'm seeing End-of-File-Exceptions in my Spring Boot server app running with embedded Jetty, when the client closes the connection (maybe due to a timeout?).

I'm able to handle these in an @ExceptionHandler, but afterwards another Exception will be caused since the MVC framework still tries to send a response. While debugging through the framework code I could see that for error cases the Cache-Control header is set preliminary. Also the default response code is HTTP-200 when I do nothing in the @ExceptionHandler method. Both parts, the response code and response header, lead to errors since the OutputStream is closed already.

I asked on SO if Spring MVC can be told to respond not at all, but I got no answer and I also think it's not possible atm.
Hence I'd like to ask for this as a feature request.

My larger goal is to keep our application log free of such exception logs (on ERROR level!) that can happen regularly and are introduced by the client.

Comment From: bclozel

Thanks for getting in touch but Spring Framework 5.2.x is out of open source support. We can reopen this issue if you manage to reproduce this problem on a supported Spring Boot version.