When asked for a connection, the RoundRobindLoadBalancer is selecting the least saturated server. This least saturated server is selected based on the total number of connection it receives: the server with the less total number of connection will be selected, which is basically the equivalent to a round robin algorithm.
This server selection is also based on the server status: a server which has been declared offline cannot be selected. In other words, this offline server will not receive any connection request and as a consequence, its counter of total number of connection will stall while the counter of the others server will continue to grow.
When the offline server comes back online, given that its total number of connection will be way lower than the other, it will always be selected as being the least saturated server until its total number of connection reach the same number than counter of the other servers.
- A quick work-around would be to *not* forward the server status to the dispatcher but that mean that the server following the offline one will get twice the load.
- A better solution would be to invoke dispatcher.terminatedOperation() when the connection is closed. Making the RoundRobinLoadBalancer acting effectively like a LeastConnectionLoadBalancer.