Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
5.0.3, 5.1-beta1
-
None
Description
I am using async http client for real time bidding project in a cluster of servers. Each server execute around 6K request per second and sometimes each server restarted becase I/O reactor is shutdown. It seems that there is a race condition in the code that produces this behavior.
It seems that the race condition appears between this method:
org.apache.hc.client5.http.impl.async.AsyncConnectExec$1.completed()
and this method:
org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager$InternalConnectionEndpoint.setSocketTimeout()
because in the first method the endpoint is connected but in the second one this code fails:
ManagedHttpClientConnection getValidatedConnection() { final ManagedHttpClientConnection conn = getConnection(); Asserts.check(conn.isOpen(), "Endpoint is not connected"); return conn; }