eclipse-ee4j/jersey

AsyncContext completion attempt after AsyncListener.onError is called

wendigo opened this issue · 5 comments

We've observer an issue with Jersey 3.1.+ running in the Jetty EE10 container that applies to HTTP/2 protocol.

When client disconnects in the middle of the request (due to a timeout or whatever), it sends a RST_STREAM frame that on the server side, finishes an AsyncContext with an error through the AsyncListener.onError. It seems that Jersey doesn't understand this condition, and still tries to finish an AsyncContext when the AsyncResponse.complete is called. Since Jetty recycles request/response objects on AsyncContext error, there is no response to write output to, and the jersey code generates a non-actionable warning.

We've work around this issue by implementing trinodb/trino#22315 that seems to do a trick. I'd like to see a permanent solution on the Jersey side instead.

@lorban anything else to add here?

@wendigo no; you accurately described the problem.

It looks like creating the test case is the most difficult part here

@jansupol is there a plan to fix this issue?

Yes, we plan to check on the possibilities for this.