Skip to content

Commit a3d885a

Browse files
committed
fixed some comments
1 parent 806c203 commit a3d885a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/main/com/mongodb/MongoOptions.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ else if (safe)
112112
public boolean socketKeepAlive;
113113

114114
/**
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
121122
*
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.
124124
* Default is false.
125125
*/
126126
public boolean autoConnectRetry;

0 commit comments

Comments
 (0)