Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-763

Allow configuration of heartbeat background threads to be set via API

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None

    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

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            jantje.daniel Ian Daniel
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: