<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:12:11 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>[CDRIVER-1329] maxTimeMS and maxAwaitTimeMS should be Int64, not Int32</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-1329</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;The &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;CRUD spec&lt;/a&gt; defines &lt;tt&gt;maxTimeMS&lt;/tt&gt; and &lt;tt&gt;maxAwaitTimeMS&lt;/tt&gt; as Int64.  Where the C driver handles these in a typed way (as opposed to query-to-command conversion), it expects Int32.&lt;/p&gt;

&lt;p&gt;The following functions use &lt;tt&gt;uint32_t&lt;/tt&gt; for &quot;maxTimeMS&quot; and should be changed:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;tt&gt;mongoc_cursor_get_max_await_time_ms()&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;mongoc_cursor_set_max_await_time_ms()&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;mongoc_find_and_modify_opts_get_max_time_ms()&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;mongoc_find_and_modify_opts_set_max_time_ms()&lt;/tt&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="294103">CDRIVER-1329</key>
            <summary>maxTimeMS and maxAwaitTimeMS should be Int64, not Int32</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="david.golden@mongodb.com">David Golden</reporter>
                        <labels>
                    </labels>
                <created>Wed, 15 Jun 2016 13:57:16 +0000</created>
                <updated>Mon, 16 Oct 2023 06:22:15 +0000</updated>
                                                            <fixVersion>2.0.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1943532" author="jmikola@gmail.com" created="Tue, 10 Jul 2018 18:45:28 +0000"  >&lt;p&gt;&lt;tt&gt;mongoc_find_and_modify_opts_set_max_time_ms()&lt;/tt&gt; accepts a &lt;tt&gt;uint32_t&lt;/tt&gt; and the options struct internally tracks &lt;tt&gt;max_time_ms&lt;/tt&gt; as &lt;tt&gt;uint32_t&lt;/tt&gt;. In &lt;tt&gt;mongoc_collection_find_and_modify_with_opts()&lt;/tt&gt;, the value is appended with &lt;tt&gt;BSON_APPEND_INT32&lt;/tt&gt;. We should be able to cast the value as an &lt;tt&gt;int64_t&lt;/tt&gt; and append as a 64-bit BSON integer, which would remove the risk of &lt;tt&gt;UINT32_MAX&lt;/tt&gt; turning into &lt;tt&gt;INT32_MIN&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;Similarly, &lt;tt&gt;mongoc_cursor_set_max_await_time_ms()&lt;/tt&gt; and &lt;tt&gt;mongoc_cursor_get_max_await_time_ms()&lt;/tt&gt; use &lt;tt&gt;uint32_t&lt;/tt&gt; but store the value as an int64 in the cursor&apos;s options &lt;tt&gt;bson_t&lt;/tt&gt;. This effectively limits the value to &lt;tt&gt;UINT32_MAX&lt;/tt&gt;. However, users could theoretically pass a larger non-negative 64-bit integer as &quot;maxAwaitTimeMS&quot; via the find options and ignore the getter&apos;s limitation. That said, we still have a problem in &lt;tt&gt;&lt;em&gt;mongoc_cursor_prepare_getmore_command()&lt;/tt&gt;, as it uses the getter (which will cast down the original &lt;tt&gt;int64_t&lt;/tt&gt;) and _also&lt;/em&gt; uses &lt;tt&gt;bson_append_int32&lt;/tt&gt; to append, which also carries the risk of &lt;tt&gt;UINT32_MAX&lt;/tt&gt; turning into &lt;tt&gt;INT32_MIN&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;I believe both of those issues related to appending can be fixed in a 1.x release without any ABI or BC concerns, as they&apos;re internal bug fixes.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="569924">CDRIVER-2734</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2285096">CDRIVER-4589</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="266732">CXX-849</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10012"><![CDATA[Major Change]]></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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>CDRIVER-4742</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr6kzr:</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>