@@ -112,15 +112,15 @@ else if (safe)
112
112
public boolean socketKeepAlive ;
113
113
114
114
/**
115
- * If true, the driver will keep trying to connect to the server in case that the socket cannot be established.
116
- * This can be useful to avoid exceptions being thrown when a server is down temporarily by blocking the operations.
117
- * Note that it is not a good solution for many applications because:
118
- * - in general infinite retries is not advised, the application can get stuck in case of long server down time
119
- * - for a replica set, the driver will keep trying to connect to the same host, even if the master has changed
120
- * - this does not apply to read/write exceptions on the socket
115
+ * If true, the driver will keep trying to connect to the same server in case that the socket cannot be established.
116
+ * There is maximum amount of time to keep retrying, which is 15s by default.
117
+ * This can be useful to avoid some exceptions being thrown when a server is down temporarily by blocking the operations.
118
+ * It also can be useful to smooth the transition to a new master (so that a new master is elected within the retry time).
119
+ * Note that when using this flag:
120
+ * - for a replica set, the driver will trying to connect to the old master for that time, instead of failing over to the new one right away
121
+ * - this does not prevent exception from being thrown in read/write operations on the socket, which must be handled by application
121
122
*
122
- * For most applications it is advised to keep this setting off and handle exceptions properly in the application.
123
- * The driver already has mechanisms to automatically recreate dead connections and retry read operations.
123
+ * Even if this flag is false, the driver already has mechanisms to automatically recreate broken connections and retry the read operations.
124
124
* Default is false.
125
125
*/
126
126
public boolean autoConnectRetry ;
0 commit comments