Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
2.1.1
-
None
Description
We changed the connector to use the mariadb one (latest version). And so instead of "maxReconnects" we use "retriesAllDown" option in the connection string.
In the code I see:
/**
- When using loadbalancing, the number of times the driver should cycle through available hosts, attempting to connect.
- Between cycles, the driver will pause for 250ms if no servers are available.
*/
RETRY_ALL_DOWN("retriesAllDown", 120, 0, "1.2.0"),
So I would think that between 2 connection tries (try the whole list of master/slaves) it would wait for ¼ seconds but looking at the code in
public static void loop(Listener listener, final List<HostAddress> addresses,
SearchFilter searchFilter) throws SQLException
I see no sleep and I have put some logs and I noticed that the connector tried to connect almost 1 million times in +/- 70 seconds (the time for mariadb container to start, load data and restart).
So I am obliged to put an arbitrary very high value for "retriesAllDown".
I think a quick fix would be to put a sleep 250ms at the end of the while loop to match what's in the above comment.
Or add like for mysql a parameter to wait a little more between 2 consecutive failed tries.