-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: SDAM
-
None
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.