@@ -37,6 +37,7 @@ public void reset(){
37
37
socketTimeout = 0 ;
38
38
socketKeepAlive = false ;
39
39
autoConnectRetry = false ;
40
+ maxAutoConnectRetryTime = 0 ;
40
41
slaveOk = false ;
41
42
safe = false ;
42
43
w = 0 ;
@@ -124,6 +125,12 @@ else if (safe)
124
125
*/
125
126
public boolean autoConnectRetry ;
126
127
128
+ /**
129
+ * The maximum amount of time in MS to spend retrying to open connection to the same server.
130
+ * Default is 0, which means to use the default 15s if autoConnectRetry is on.
131
+ */
132
+ public long maxAutoConnectRetryTime ;
133
+
127
134
/**
128
135
* This flag specifies if the driver is allowed to read from secondary (slave) servers.
129
136
* Specifically in the current implementation, the driver will avoid reading from the primary server and round robin requests to secondaries.
@@ -185,6 +192,7 @@ public String toString(){
185
192
buf .append ( "socketTimeout=" ).append ( socketTimeout ).append ( ", " );
186
193
buf .append ( "socketKeepAlive=" ).append ( socketKeepAlive ).append ( ", " );
187
194
buf .append ( "autoConnectRetry=" ).append ( autoConnectRetry ).append ( ", " );
195
+ buf .append ( "maxAutoConnectRetryTime=" ).append ( maxAutoConnectRetryTime ).append ( ", " );
188
196
buf .append ( "slaveOk=" ).append ( slaveOk ).append ( ", " );
189
197
buf .append ( "safe=" ).append ( safe ).append ( ", " );
190
198
buf .append ( "w=" ).append ( w ).append ( ", " );
0 commit comments