[JAVA-1217] Increase retry frequency of heartbeat only when necessary Created: 13/May/14  Updated: 31/Mar/15  Resolved: 14/May/14

Status: Closed
Project: Java Driver
Component/s: Cluster Management
Affects Version/s: 2.12.0
Fix Version/s: 2.12.2, 3.0.0

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

If the driver is unable to connect to a server that it's supposed to be monitoring, the current behavior is to retry with a frequency governed by MongoClientOptions.heartbeatConnectRetryFrequency. But it's not always necessary to do this. For example, it's normal for a server to go down for maintenance, and there is no reason to retry connecting to it so long as there are other servers available that are reachable.

Instead, the driver should always retry connecting at the normal frequency, governed by MongoClientOptions.heartbeatFrequency, even if the server is unreachable. The driver should then increase the frequency only when it is asked to execute an operation and is unable to find an appropriate server to use.



 Comments   
Comment by Jeffrey Yemin [ 31/Mar/15 ]

Closing all resolved 3.0.0 issues, as 3.0.0 has been tagged and released.

Comment by Githook User [ 30/Jan/15 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-1217: Instead of increasing the retry frequency for an unreachable server, always use the same frequency, and force an attempt to connect only when there is a failure of the server selector to find a matching server.
JAVA-1284: MongoTimeoutException should include the total time waited before timing out, not just the last time through the loop
JAVA-1285: When server selection fails to find a match, await only for connectRetryFrequency, instead of maxWaitTime, so that attempts to re-connect to each server happen more frequently.
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/4f969b79d955bb5b90e1db947a7e1f682b19f918

Comment by Githook User [ 01/Aug/14 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-1217: Instead of increasing the retry frequency for an unreachable server, always use the same frequency, and force an attempt to connect only when there is a failure of the server selector to find a matching server.
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/0e20f72226a0d68d0f20eb63a417ba4040b2045a

Comment by Githook User [ 24/Jun/14 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-1217: Instead of increasing the retry frequency for an unreachable server, always use the same frequency, and force an attempt to connect only when there is a failure of the server selector to find a matching server.
JAVA-1284: MongoTimeoutException should include the total time waited before timing out, not just the last time through the loop
JAVA-1285: When server selection fails to find a match, await only for connectRetryFrequency, instead of maxWaitTime, so that attempts to re-connect to each server happen more frequently.
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/4f969b79d955bb5b90e1db947a7e1f682b19f918

Comment by Githook User [ 14/May/14 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-1217: Instead of increasing the retry frequency for an unreachable server, always use the same frequency, and force an attempt to connect only when there is a failure of the server selector to find a matching server.
Branch: 2.12.x
https://github.com/mongodb/mongo-java-driver/commit/0e20f72226a0d68d0f20eb63a417ba4040b2045a

Generated at Thu Feb 08 08:54:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.