Fixed connection manager logic - #158
Conversation
…ts internal logic for establishing connections in the event of a partial or complete failure.
|
I'd like to add a more detailed description of what's changed: Previously, when a connection to a host is being failed for some time under constant load, several of the request threads which tried to acquire a connection may turn on the connection mode simultaneously (how many -- depends on the request rate and the timeout to wait until a connection fails). This was happening because there were only two connection states -- "ON" (represented by FULL/PARTIAL) and "OFF", and this led to a situation when one thread finished connecting, a second is waiting until the connection process finishes, and a third starts connecting immediately as it catches the NoAvailableConnectionsException and sees the connection state as "OFF". In this patch, a new connection state is added -- IN_PROGRESS, and such race condition is not more possible since only one thread actually can set the state IN_PROGRESS, and only it can switch it back to OFF when the connection process is finished (succeed or failed). |
* Fixed concurrent access to the creation of a connection manager and its internal logic for establishing connections in the event of a partial or complete failure. * Add log and bump netty version
Fixed concurrent access to the creation of a connection manager and its internal logic for establishing connections in the event of a partial or complete failure.
Fixes #149