When using Jersey asyncResponse not able to read e

2019-03-06 11:29发布

问题:

We have started using asyncResponse in one of the test service and when trying to read data from input stream in a separate thread than from the incoming thread we are getting a race condition where the entire data from the client is not read. The server is closing the request abruptly.

Edit1

I have enabled debug logs and I have found the following things.

All the data is read in the new thread pool which I created except for the 16K which is read in the incoming jetty thread. And exactly this 16k is what I am missing in the full content. This happens once in a while hard to reproduce as well.

Incoming thread log message

2018-07-02 19:42:07,522 | DEBUG | qtp397146575-263                 | rg.eclipse.jetty.http.HttpParser |  | filled 16384/16384

New thread pool log message

2018-07-02 19:42:54,333 | DEBUG | Thread-100                 | rg.eclipse.jetty.http.HttpParser | | filled 16384/16384
标签: jersey Jetty