<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 09:04:14 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[JAVA-5302] Validate heartbeatFrequency in ServerSettings</title>
                <link>https://jira.mongodb.org/browse/JAVA-5302</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;The &lt;b&gt;&lt;tt&gt;DefaultServerMonitor&lt;/tt&gt;&lt;/b&gt; fails with an &lt;b&gt;&lt;tt&gt;ArithmeticException&lt;/tt&gt;&lt;/b&gt; due to &lt;b&gt;&lt;tt&gt;Math.toIntExact(serverSettings.getHeartbeatFrequency(MILLISECONDS))&lt;/tt&gt;&lt;/b&gt; exceeding integer limits. This is caused by missing validation in &lt;b&gt;&lt;tt&gt;ServerSettings&lt;/tt&gt;&lt;/b&gt; for &lt;b&gt;&lt;tt&gt;heartbeatFrequency&lt;/tt&gt;&lt;/b&gt;, allowing inputs higher than &lt;tt&gt;Integer.MAX_VALUE&lt;/tt&gt; and preventing &lt;b&gt;&lt;tt&gt;DefaultServerMonitor&lt;/tt&gt;&lt;/b&gt; from sending a hello command.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Proposed Changes:&lt;/b&gt;&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Implement integer validation in &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/blob/d9aa6044e1a6b440bcb013c330497f2813484050/driver-core/src/main/com/mongodb/connection/ServerSettings.java#L102&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;ServerSettings#heartbeatFrequency&lt;/tt&gt;&lt;/a&gt; to check for values not exceeding &lt;tt&gt;Integer.MAX_VALUE similarly to &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/blob/0ecac8cfbd6a2c902c1366a4bb39dcfc100379da/driver-core/src/main/com/mongodb/connection/SocketSettings.java#L288&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;SocketSettings.java#L288.&lt;/a&gt;&#160;&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;Update the Javadoc for &lt;tt&gt;heartbeatFrequency&lt;/tt&gt; to clearly state the integer value limitation, aligning with the documentation style in &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/blob/0ecac8cfbd6a2c902c1366a4bb39dcfc100379da/driver-core/src/main/com/mongodb/connection/SocketSettings.java#L112&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;SocketSettings#readTimeout&lt;/tt&gt;&lt;/a&gt; and &lt;tt&gt;connectTimeout&lt;/tt&gt;.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&lt;b&gt;Acceptance Criteria:&lt;/b&gt;&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;&lt;tt&gt;heartbeatFrequency&lt;/tt&gt; in &lt;tt&gt;ServerSettings&lt;/tt&gt; validates values to ensure they do not exceed &lt;tt&gt;Integer.MAX_VALUE&lt;/tt&gt;.&lt;/li&gt;
	&lt;li&gt;The updated Javadoc accurately reflects the integer value limitation.&lt;/li&gt;
	&lt;li&gt;A test case confirms that an error is thrown when a long value exceeding &lt;tt&gt;Integer.MAX_VALUE&lt;/tt&gt; is used.&lt;/li&gt;
&lt;/ol&gt;
</description>
                <environment></environment>
        <key id="2559524">JAVA-5302</key>
            <summary>Validate heartbeatFrequency in ServerSettings</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="slav.babanin@mongodb.com">Slav Babanin</reporter>
                        <labels>
                    </labels>
                <created>Mon, 29 Jan 2024 06:56:57 +0000</created>
                <updated>Mon, 29 Jan 2024 16:47:18 +0000</updated>
                                            <version>4.11.0</version>
                                                    <component>Configuration</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                        <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                    <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="26442"><![CDATA[Java Drivers]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i2s7j0:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>