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

Possible bug in Heartbeat Socket settings

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: SDAM
    • None
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Summary

      While adjusting socketsettings, we noticed that heartbeat socketsettings were also getting modified.  This appears to be intentional and makes sense.  However, this code appears to be bugged, in that the connect timeout from socket settings is being propagated to both the connect and read timeouts of the heartbeat.  From MongoClientSettings:

      heartbeatSocketSettings = SocketSettings.builder()
      .readTimeout(builder.heartbeatSocketTimeoutMS == 0
      ? socketSettings.getConnectTimeout(MILLISECONDS) : builder.heartbeatSocketTimeoutMS,
      MILLISECONDS)
      .connectTimeout(builder.heartbeatConnectTimeoutMS == 0
      ? socketSettings.getConnectTimeout(MILLISECONDS) : builder.heartbeatConnectTimeoutMS,
      MILLISECONDS)

      Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).

      Java 4.11.1 

      How to Reproduce

      Configure any new MongoClient, specifying socket settings with a non-zero connect timeout.  Note that this propagates into the heartbeat socket settings read timeout.

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            kroc8@allstate.com Kenneth Robinson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: