[JAVA-1014] Allow configuration of heartbeat background threads to be set via API Created: 14/Oct/13  Updated: 31/Mar/15  Resolved: 29/Apr/14

Status: Closed
Project: Java Driver
Component/s: API, Cluster Management, Configuration
Affects Version/s: None
Fix Version/s: 3.0.0

Type: New Feature 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

Epic Link: Allow configuration of heartbeat background threads to be set via API

 Description   

The Java driver, as of version 2.9.0, supports automatic failover of mongos instances (JAVA-381). The parameters that determine the wait time when the active mongos becomes unavailable, until choosing a new mongos, are only available as system properties. They cannot be set directly via the driver API. This ticket is to add API support for directly specifying the failover timeout value.

For the record, the relevant system properties, and their default values, are:

updaterIntervalMS = Integer.parseInt(System.getProperty("com.mongodb.updaterIntervalMS", "5000"));
updaterIntervalNoMasterMS = Integer.parseInt(System.getProperty("com.mongodb.updaterIntervalNoMasterMS", "10"));
mongoOptionsDefaults.connectTimeout = Integer.parseInt(System.getProperty("com.mongodb.updaterConnectTimeoutMS", "20000"));
mongoOptionsDefaults.socketTimeout = Integer.parseInt(System.getProperty("com.mongodb.updaterSocketTimeoutMS", "20000"));

The maximum time to failover to a new mongos is:

Sum of: <com.mongodb.updaterIntervalMS> + max(com.mongodb.updaterSocketTimeoutMS, com.mongodb.updaterConnectTimeoutMS, ping time) for each mongos

The new options are:

  • MongoClientOptions#getHeartbeatFrequency
  • MongoClientOptions#getHeartbeatConnectRetryFrequency
  • MongoClientOptions#getHeartbeatConnectTimeout
  • MongoClientOptions#getHeartbeatSocketTimeout
  • MongoClientOptions#getHeartbeatThreadCount


 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-1014: Heartbeat thread count is configurable via com.mongodb.MongoClientOptions
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/4780246170ab3d6f32fb3f410f80e6a4871f0d0a

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-1014: Heartbeat thread count is configurable via ServerSettings and org.mongodb.MongoClientOptions
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/63a989ecf8a1058aaaec07ed21c0b6264cd090c8

Comment by Githook User [ 29/Apr/14 ]

Author:

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

Message: JAVA-1014: Heartbeat thread count is configurable via com.mongodb.MongoClientOptions
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/4780246170ab3d6f32fb3f410f80e6a4871f0d0a

Comment by Githook User [ 29/Apr/14 ]

Author:

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

Message: JAVA-1014: Heartbeat thread count is configurable via ServerSettings and org.mongodb.MongoClientOptions
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/63a989ecf8a1058aaaec07ed21c0b6264cd090c8

Comment by Jeffrey Yemin [ 14/Oct/13 ]

This is done, accept for heartbeatThreadCount

Comment by Jeffrey Yemin [ 14/Oct/13 ]

Author:

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

Message: JAVA-763: Allow setting of existing heartbeat-related system properties via MongoClientOptions
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/e878d90eb51b509dcee16c4dffc64bf1d9eb857d

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