Open zhaochun-ma opened 5 months ago
if I run the server with debugger, start up a client to send the same request, I set a breakpoint where the httpconnection is reading from input, while the request is being read by server, I stopped the client, then I continue the server. (this probably simulates the request was read incompletely). This time the EofException propagates all the way up to one of the ExceptionMappers registered with jetty. and 500 was returned.
[2024-04-26 11:01:51,451] ERROR Unhandled exception resulting in internal server error response
org.eclipse.jetty.io.EofException
at org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory$HTTPServerSessionListener.onFailure(HTTP2ServerConnectionFactory.java:167)
.... same stacktrace ....
I’m not sure what is the expected behavior for jetty here. Should we just add a exception mapper similar to this to handle this kind of exception?: https://github.com/SDA-SE/sda-dropwizard-commons/blob/1464533eda1061cf8d374ac8d511[…]dase/commons/server/jackson/errors/EarlyEofExceptionMapper.java
@zhaochun-ma jetty-9.4 is at end of community support. In case you missed the announcement, including your options going forward, here it is: https://www.eclipse.org//lists/jetty-announce/msg00168.html
While we upgrade our jetty library, is this issue fixed on newer version? would you suggest adding an exception mapper to handle this kind of exception as a temporary workaround?
There have been tens of thousands of commits of difference between Jetty 9.4.x and 12.0.x
We don't have reports of similar concerns in Jetty 12.0.x, that's about as close to an answer we can provide. We suggest that you upgrade your version of Jetty and don't use/rely on workarounds for End of Community Support versions of Jetty.
Note: Jetty 11 and older are all now either at End of Life or End of Community Support.
You should be running Jetty 12 at this point in time.
Jetty version(s)
9.4.54
Jetty Environment
Java version/vendor
(use: java -version)
java 11OS type/version linux
Description
How to reproduce?
the below stacktrace was logged in the application when handling a request. The application was under heavy load at the time and request were experiencing long latency. This
org.eclipse.jetty.io.EofException
propagates all the way up to one of the ExceptionMappers registered with jetty. We didn't particularly handle this exception, so it was eventually returned as 500 error.I did some local debugging to mimic the scenario: enable jetty server debug level log. start up a client to send a request and stop the client before it receives the response. The same stacktrace was logged with
but in application log, the exception wasn't caught by ExceptionMappers and the request was returned as HTTP 200. I'm not sure if we should have an ExceptionMapper to catch this exception.