DBZ-6113 Correct max reconnect attempts
Originally there are max+1 attempts
This commit is contained in:
parent
a587b3b7ef
commit
fcc44edf0b
@ -136,6 +136,7 @@ Eric Weaver
|
||||
Eric S. Kreiseir
|
||||
Erik Malm
|
||||
Ethan Zou
|
||||
Eugene Abramchuk
|
||||
Ewen Cheslack-Postava
|
||||
Ezer Karavani
|
||||
Fabian Aussems
|
||||
|
@ -284,7 +284,7 @@ protected Supplier<MongoClient> preferredClientFor(ReplicaSet replicaSet, ReadPr
|
||||
catch (Throwable t) {
|
||||
handler.failed(attempts, maxAttempts - attempts, t);
|
||||
}
|
||||
if (attempts > maxAttempts) {
|
||||
if (attempts >= maxAttempts) {
|
||||
throw new ConnectException("Unable to connect to " + preference.getName() + " node of '" + replicaSet +
|
||||
"' after " + attempts + " failed attempts");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user