AsyncHttpClient / async-http-client

Asynchronous Http and WebSocket Client library for Java
Other
6.28k stars 1.59k forks source link

Reaper thread interrupts its own thread when it awakes in NettyResponseFuture #249

Closed PierreCoquentin closed 10 years ago

PierreCoquentin commented 11 years ago

The reaper thread when it wakes up, call cancelReaper in abort method of class NettyResponseFuture. This method cancel the reaper future by calling :

reaperFuture.cancel(true);

The parameter "true" indicates that the thread should be interrupted. As it's the reaper thread, it will only flag the thread as interrupted, and thus leads to some strange behavior afterwards. I think that the reaper should not call this method and in addition to the bug #247, if the worker thread and reaper thread run at the same time, the worker thread should not call cancelReaper if it's the reaper thread which invokes onThrowable method of the async client.

slandelle commented 10 years ago

I've fully reimplemented timeout logic in 1.7.25 on top of Netty's HashedWheelTimer.