-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Connection reset exception in a Spring Web MVC controller method is ignored #34264
Comments
It's a regression introduced by 203fa75. |
Fix spring-projectsGH-34264 Signed-off-by: Yanming Zhou <[email protected]>
Fix spring-projectsGH-34264 Signed-off-by: Yanming Zhou <[email protected]>
…xception Fix spring-projectsGH-34264 Signed-off-by: Yanming Zhou <[email protected]>
@quaff thanks for the quick fix. But wouldn't it only fix the issue for the case when |
…xception Fix spring-projectsGH-34264 Signed-off-by: Yanming Zhou <[email protected]>
It should works for all http client provided by Spring Framework, like |
True, but what if I use any other client, e.g., Java HTTP client directly? |
The
So the point here is to reduce the logging, and this heuristic makes sense in most of the cases. And even for false positive cases, not logging the exception might not be that critical. But the controller method also returns 200 OK in such case, and I think that's the real problem, as it breaks the expected behavior. |
See spring-projects#34264 (comment) Signed-off-by: Yanming Zhou <[email protected]>
I agree with you, I appended another commit to fix it, let's wait for team member's response. |
Consider a Spring Web MVC controller method that calls some downstream http service:
Starting from Spring Boot 3.4.0 (Spring Web 6.2.0), if calling the downstream service produces a "Connection reset" error, it is silently ignored. This endpoint would return 200 OK in such case.
Before Spring Web 6.2.0, calling this endpoint
http://localhost:8080/hello
would result in HTTP error code 500, with the following logs:After Spring Web 6.2.0 (Spring Boot 3.4.0), the logs look as follows, note the line "Looks like the client has gone away" — it's coming from DisconnectedClientHelper that assumes for some reason that the "Connection reset" exception comes from the client. Note that the exception is completely ignored, and the endpoint returns 200 OK:
A simple reproducer follows.
The text was updated successfully, but these errors were encountered: