spring-projects / spring-framework

Spring Framework
https://spring.io/projects/spring-framework
Apache License 2.0
56.8k stars 38.18k forks source link

Infinite loop with custom error controller when "406 Not Acceptable" [SPR-12066] #16682

Closed spring-projects-issues closed 10 years ago

spring-projects-issues commented 10 years ago

Sin-young "Divinespear" Kang opened SPR-12066 and commented

(excuse my broken english :P)

before start: some web crawlers try invalid Accept header to avoid blocking.

I've build my webapp using spring-boot, and it worked well. some hours after release, server reported servlet container (I use Jetty) consume all system resources.

and log pointed there is infinite loop on error handling filter.

To Reproduce

  1. build webapp using spring-boot (autoconfigured BasicErrorController) or configure custom error controller (may with @ResponseBody for return JSON to reproduce.).
  2. run servlet container
  3. open terminal and type curl -H "Accept: application/octet-stream" http://localhost:8080/<context-path>/error

Possible Solution when previous status code detected and it's 406, wrap ServletRequest and avoid return Accept header.


Affects: 4.0.6

spring-projects-issues commented 10 years ago

Sébastien Deleuze commented

Hi,

If this is a Spring Boot related issue, then you should report it on Spring Boot bugtracker, not here.

I can't reproduce the issue with Spring Framework 4.0.6 and Spring Boot 1.1.4, so if you think this is a Spring Framework related issue, could you provide a sample project that allows to reproduce the error ? You can fork https://github.com/spring-projects/spring-framework-issues and add a new #16682.

If you think it is related to Spring Boot, let me know I will close this one.

Thanks for your feedback, Sébastien

spring-projects-issues commented 10 years ago

Sébastien Deleuze commented

Please reopen if you achieve to reproduce this issue in a project without Spring Boot.

spring-projects-issues commented 10 years ago

Stéphane Nicoll commented

A boot issue has been created for this issue.

spring-projects-issues commented 10 years ago

Andy Wilkinson commented

And I've just determined that the issue's already been fixed under 1257. The fix will be in Spring Boot 1.1.5.