From e0f4c5c09c2a531ce4c2e447b7b66acdd6f77122 Mon Sep 17 00:00:00 2001 From: Alexander Soklakov Date: Fri, 23 Nov 2018 16:33:12 +0400 Subject: [PATCH] Fix for SequentialBalanceStrategy. --- .../java/com/mysql/cj/jdbc/ha/SequentialBalanceStrategy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/user-impl/java/com/mysql/cj/jdbc/ha/SequentialBalanceStrategy.java b/src/main/user-impl/java/com/mysql/cj/jdbc/ha/SequentialBalanceStrategy.java index f5192a452..a63df2492 100644 --- a/src/main/user-impl/java/com/mysql/cj/jdbc/ha/SequentialBalanceStrategy.java +++ b/src/main/user-impl/java/com/mysql/cj/jdbc/ha/SequentialBalanceStrategy.java @@ -57,7 +57,7 @@ public ConnectionImpl pickConnection(InvocationHandler proxy, List confi Map blackList = ((LoadBalancedConnectionProxy) proxy).getGlobalBlacklist(); - for (int attempts = 0; attempts < numRetries;) { + for (int attempts = 0; attempts < numRetries; attempts++) { if (numHosts == 1) { this.currentHostIndex = 0; // pathological case } else if (this.currentHostIndex == -1) {