eclipse-ee4j / eclipse-ee4j/jersey

AsyncContext completion attempt after AsyncListener.onError is called

Open
#5,675 15 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

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 https://github.com/trinodb/trino/pull/22315 that seems to do a trick. I'd like to see a permanent solution on the Jersey side instead.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Jersey 3.1.+ case in a Jetty EE10 container over HTTP/2, then trace the AsyncListener.onError and AsyncResponse.complete entry points during a client disconnect. The work is done when the error path does not attempt a second AsyncContext completion or emit the non-actionable warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.