Hi!
Are there any plans to improve performance of the stale connection
check?
Unfortunately, we can not currently migrate to HttpClient because we
can't afford 15-30 ms for stale checks in our environment where complete
HTTP requests take 10 ms. We do need the robustness provided by stale
checks so disabling them is not a good option for us.
One way to implement fast stale checks is to use non-blocking reads with
channels:
try {
channel.configureBlocking( false );
count = channel.read( buffer );
// connection closed if count == -1 (log EOF)
}
catch( Exception e ) {
// connection reset (log exception)
}
finally {
channel.configureBlocking( true );
}
This code successfully detects closed and aborted/reset connections, and
runs in < 1 ms.
Thanks.
- Andrew