@@ -37,6 +37,7 @@ public void reset(){
3737 socketTimeout = 0 ;
3838 socketKeepAlive = false ;
3939 autoConnectRetry = false ;
40+ maxAutoConnectRetryTime = 0 ;
4041 slaveOk = false ;
4142 safe = false ;
4243 w = 0 ;
@@ -124,6 +125,12 @@ else if (safe)
124125 */
125126 public boolean autoConnectRetry ;
126127
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+
127134 /**
128135 * This flag specifies if the driver is allowed to read from secondary (slave) servers.
129136 * 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(){
185192 buf .append ( "socketTimeout=" ).append ( socketTimeout ).append ( ", " );
186193 buf .append ( "socketKeepAlive=" ).append ( socketKeepAlive ).append ( ", " );
187194 buf .append ( "autoConnectRetry=" ).append ( autoConnectRetry ).append ( ", " );
195+ buf .append ( "maxAutoConnectRetryTime=" ).append ( maxAutoConnectRetryTime ).append ( ", " );
188196 buf .append ( "slaveOk=" ).append ( slaveOk ).append ( ", " );
189197 buf .append ( "safe=" ).append ( safe ).append ( ", " );
190198 buf .append ( "w=" ).append ( w ).append ( ", " );
0 commit comments