-
Type: Bug
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: 4.11.0
-
Component/s: Configuration
-
None
-
Java Drivers
The DefaultServerMonitor fails with an ArithmeticException due to Math.toIntExact(serverSettings.getHeartbeatFrequency(MILLISECONDS)) exceeding integer limits. This is caused by missing validation in ServerSettings for heartbeatFrequency, allowing inputs higher than Integer.MAX_VALUE and preventing DefaultServerMonitor from sending a hello command.
Proposed Changes:
- Implement integer validation in ServerSettings#heartbeatFrequency to check for values not exceeding Integer.MAX_VALUE similarly to SocketSettings.java#L288.
- Update the Javadoc for heartbeatFrequency to clearly state the integer value limitation, aligning with the documentation style in SocketSettings#readTimeout and connectTimeout.
Acceptance Criteria:
- heartbeatFrequency in ServerSettings validates values to ensure they do not exceed Integer.MAX_VALUE.
- The updated Javadoc accurately reflects the integer value limitation.
- A test case confirms that an error is thrown when a long value exceeding Integer.MAX_VALUE is used.