Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jersey-dev] Jersey async client losing requests occasionally

Hi folks,


I’m having a problem with lost responses in Jersey client. We have a simple async rest client written in terms of the Jersey client's fluent async interface. Intermittently (and not often), we’ll send an async request whose handler NEVER gets called. We’ve worked with this code for months trying to get it to work 100% of the time. 

We set the Jersey client timeout to no effect. These lost calls are apparently not affected by the client timeout settings – their handlers never get called even when we have a short timeout set. 

We finally wrapped the handlers and their futures in a reaper class that has a background thread that scans our outstanding call list every 30 seconds. If a handler is not called in some way within our timeout period, we just assume the call is lost and fail the request by calling the handler’s failed method. The caller then resubmits the request, which usually works just fine.

This happens more predictably when the server is bounced while making a rapid series of client calls.


Any thoughts? I’ve done google searches until I’m sick. My SO post has given me no love ( I just can’t understand how a bug this glaringly bad can exist in the Jersey client.


Thanks in advance,

John Calcote

Back to the top