Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-529

retriesAllDown not working as expected

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.2.1, 1.7.1
    • Component/s: Failover
    • Labels:
      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.

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            Eddy Hautot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration