tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 61768] New: Processor for async requests are recycled before complete is called on AsyncContext
Date Thu, 16 Nov 2017 15:58:05 GMT

            Bug ID: 61768
           Summary: Processor for async requests are recycled before
                    complete is called on AsyncContext
           Product: Tomcat 8
           Version: 8.5.20
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Connectors
  Target Milestone: ----

Our Product offers different REST APIs based on jax-rs 2.1 and Jersey 2.26.

We are facing Problems with asynchronous Requests (using and the Recycling of Processors

The SSE Endpoints are asynchronous and kept open for a long time.
If the async Context is completed on Server Side, then it works as expected.

But when a Client closes the Connection on Client Side, then the Processor is
recycled and put to the recycled Processors:
The asynchronous Thread is still running and will try to write to the Response.

Because the processor (incl. request and Response object) is recycled it will
be reused by another request (synchron or asynchron).

Jersey itself uses the javax.servlet.AsyncContext only to complete once it is
finished, but it does NOT use the getResponse Method. Instead the original
Response is used. This leads to a concurrent use of the very same Response.
We observed different failures because of this (Empty or truncated Responses or
missing reponse headers)

As a Workaround we had to disable the processor pool in the connector:
With this Workaround the Problem is not happening anymore.

The proposed fix would be to release asynchronous processors only back to the
poll if they asynchronous processing is completed.

You are receiving this mail because:
You are the assignee for the bug.
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message