-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
AsyncListener.onError(...) not called if IOException occurs while calling HttpOutput.flush() #3283
Comments
@peng12341 I don't agree. I can't see anything in the servlet spec that suggests that Does your |
@gregw Thanks for your quick response. As far as I can see, spring does not register a Here is the relevant code in Spring that creates the From the Javadoc of
Isn't writing to the response from another thread an asynchronous operation? |
This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been closed due to it having no activity. |
Just stumbled upon this issue and is still valid in Jetty v12.0.5. In case of a client side disconnect ( Not sure if this is an issue in Spring (tested on Spring v6.1.2 / Boot v3.2.1), however, switching back to Tomcat or Undertow solves the issue, |
@gregw I reopened this for further investigation. |
I think I'm running into the same issue in Jetty 12.0.6. From ResponseBodyEmitter docs:
Here are some relevant comments on Spring Framework issues -
Spring Framework issue 27252 - the same issue in Undertow was labelled an Undertow bug:
When an IOException happens, the However, maybe this is all moot, as spring-projects/spring-framework#32629 was just closed with commit spring-projects/spring-framework@c6b6ccd (which removes the |
I'm running into the same issue on 12.0.10 #12008 In addition to my async listener not being called, the IOException that results from the client disconnecting isn't thrown to my catch block for handling it. Instead it seems that it is being caught internally by Jetty and logged, but not thrown. |
@kshep92 I think this is perhaps a different issue to what you are seeing in #12008, as you are using an async servlet, but with blocking IO. So exceptions are reported by exceptions thrown from write and flush calls. So let's keep looking at your specific example in #12008 separately unless we find they really are the same. @sbordet Let's work on a reproducer that can be deployed on other containers as well so we can pin down exactly what the different behaviour is.... or see if there is actually a bug which only triggers in specific circumstances (this could be #12008). |
@gregw I agree that they are two separate issues, however, in my investigation of #12008 I found that Tomcat reported similar errors to the AsyncListener: Output from Jetty:
Output from Tomcat:
Maybe it's worth exploring for the sake of consistency? |
I'm using the Spring SseEmitter to stream events to my client. If the client closes the connection and I send the next event, the following exception occurs (correctly):
According to the following Spring issues the AsyncListener.onError-Method should also be called with that exception, but is not. (And therefore the SseEmitter never does its cleanup)
spring-projects/spring-framework#21091
spring-projects/spring-framework#20173
The text was updated successfully, but these errors were encountered: