<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:17:06 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-3087] Allow setting and getting of wtimeoutMS as an int64_t</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-3087</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;The read/write concern spec defines wtimeoutMS to be a &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/read-write-concern/read-write-concern.rst#write-concern&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;64 bit integer&lt;/a&gt;, but it is implemented as an int32_t in libmongoc. (see mongo_write_concern_(get|set)_wtimeout) For full spec compliance, there should be api for setting and retrieving wtimeoutMS as an int64_t.&lt;/p&gt;

&lt;p&gt;Currently, drivers that wrap libmongoc have no way of supporting 64-bit wtimeoutMS, so they in turn are also not spec compliant.&lt;/p&gt;</description>
                <environment></environment>
        <key id="739682">CDRIVER-3087</key>
            <summary>Allow setting and getting of wtimeoutMS as an int64_t</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="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="haris.sheikh@mongodb.com">Haris Sheikh</assignee>
                                    <reporter username="patrick.freed@mongodb.com">Patrick Freed</reporter>
                        <labels>
                            <label>neweng</label>
                    </labels>
                <created>Tue, 16 Apr 2019 17:18:50 +0000</created>
                <updated>Sat, 28 Oct 2023 11:29:19 +0000</updated>
                            <resolved>Thu, 1 Aug 2019 20:34:08 +0000</resolved>
                                                    <fixVersion>1.15.0</fixVersion>
                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2359548" author="xgen-internal-githook" created="Tue, 6 Aug 2019 14:50:29 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Haris Sheikh&apos;, &apos;username&apos;: &apos;haris-sheikh&apos;, &apos;email&apos;: &apos;harissheikh1998@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3087&quot; title=&quot;Allow setting and getting of wtimeoutMS as an int64_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3087&quot;&gt;&lt;del&gt;CDRIVER-3087&lt;/del&gt;&lt;/a&gt; fixed errors with setting and getting wtimeoutms as an int64_t&lt;br/&gt;
Branch: cdriver-2873&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/c0dbd8b679dbe2181d67c01dedc11f8a7b584f99&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/c0dbd8b679dbe2181d67c01dedc11f8a7b584f99&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2359546" author="xgen-internal-githook" created="Tue, 6 Aug 2019 14:50:23 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Haris Sheikh&apos;, &apos;username&apos;: &apos;haris-sheikh&apos;, &apos;email&apos;: &apos;harissheikh1998@gmail.com&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3087&quot; title=&quot;Allow setting and getting of wtimeoutMS as an int64_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3087&quot;&gt;&lt;del&gt;CDRIVER-3087&lt;/del&gt;&lt;/a&gt; fixed errors with setting and getting wtimeoutms as an int64_t&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit e49f2a3dc6ee3cb5bfb78ca1f96da76e2e7d8865.&lt;br/&gt;
Branch: cdriver-2873&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/8dcb0d299a40d79faad6d1f5c9034337abd84258&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/8dcb0d299a40d79faad6d1f5c9034337abd84258&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2359545" author="xgen-internal-githook" created="Tue, 6 Aug 2019 14:50:20 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Haris Sheikh&apos;, &apos;username&apos;: &apos;haris-sheikh&apos;, &apos;email&apos;: &apos;harissheikh1998@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3087&quot; title=&quot;Allow setting and getting of wtimeoutMS as an int64_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3087&quot;&gt;&lt;del&gt;CDRIVER-3087&lt;/del&gt;&lt;/a&gt; fixed errors with setting and getting wtimeoutms as an int64_t&lt;br/&gt;
Branch: cdriver-2873&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/e49f2a3dc6ee3cb5bfb78ca1f96da76e2e7d8865&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/e49f2a3dc6ee3cb5bfb78ca1f96da76e2e7d8865&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2355006" author="xgen-internal-githook" created="Thu, 1 Aug 2019 20:11:50 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Haris Sheikh&apos;, &apos;email&apos;: &apos;harissheikh1998@gmail.com&apos;, &apos;username&apos;: &apos;haris-sheikh&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3087&quot; title=&quot;Allow setting and getting of wtimeoutMS as an int64_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3087&quot;&gt;&lt;del&gt;CDRIVER-3087&lt;/del&gt;&lt;/a&gt; fixed errors with setting and getting wtimeoutms as an int64_t&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/c0dbd8b679dbe2181d67c01dedc11f8a7b584f99&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/c0dbd8b679dbe2181d67c01dedc11f8a7b584f99&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2354825" author="xgen-internal-githook" created="Thu, 1 Aug 2019 18:54:34 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Haris Sheikh&apos;, &apos;username&apos;: &apos;haris-sheikh&apos;, &apos;email&apos;: &apos;harissheikh1998@gmail.com&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3087&quot; title=&quot;Allow setting and getting of wtimeoutMS as an int64_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3087&quot;&gt;&lt;del&gt;CDRIVER-3087&lt;/del&gt;&lt;/a&gt; fixed errors with setting and getting wtimeoutms as an int64_t&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit e49f2a3dc6ee3cb5bfb78ca1f96da76e2e7d8865.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/8dcb0d299a40d79faad6d1f5c9034337abd84258&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/8dcb0d299a40d79faad6d1f5c9034337abd84258&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2354793" author="xgen-internal-githook" created="Thu, 1 Aug 2019 18:48:23 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Haris Sheikh&apos;, &apos;username&apos;: &apos;haris-sheikh&apos;, &apos;email&apos;: &apos;harissheikh1998@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3087&quot; title=&quot;Allow setting and getting of wtimeoutMS as an int64_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3087&quot;&gt;&lt;del&gt;CDRIVER-3087&lt;/del&gt;&lt;/a&gt; fixed errors with setting and getting wtimeoutms as an int64_t&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/e49f2a3dc6ee3cb5bfb78ca1f96da76e2e7d8865&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/e49f2a3dc6ee3cb5bfb78ca1f96da76e2e7d8865&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2347211" author="jmikola@gmail.com" created="Mon, 29 Jul 2019 07:31:53 +0000"  >&lt;blockquote&gt;&lt;p&gt;by properly ignore a value in that range do you mean that mongoc_uri_get_option_as_int32 should not somehow be able to set a 64-bit integer greater than INT32_MAX? Because I don&#8217;t see how that would be possible, but would you like me to add some sort of test to explicitly check that an attempt to provide a value above INT32_MAX will be ignored/raise an error?&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Looking at the implementation for &lt;tt&gt;mongoc_uri_get_option_as_int32&lt;/tt&gt;, the &lt;tt&gt;fallback&lt;/tt&gt; (zero in our case) will be returned if the option is not a 32-bit integer. Looking further at &lt;tt&gt;mongoc_uri_apply_options&lt;/tt&gt; and &lt;tt&gt;mongoc_uri_bson_append_or_replace_key&lt;/tt&gt;, I &lt;em&gt;think&lt;/em&gt; that URI options are limited to 32-bit integers and that there is no way to express a 64-bit integer.&lt;/p&gt;

&lt;p&gt;I don&apos;t think we need to change any of that, since parsing 64-bit integers would be a new feature and this extends beyond the scope of &lt;tt&gt;wtimeoutms&lt;/tt&gt;.&lt;/p&gt;</comment>
                            <comment id="2346151" author="kevin.albertson" created="Fri, 26 Jul 2019 19:01:02 +0000"  >&lt;p&gt;Regarding wtimeout of &amp;gt; INT32_MAX being ignored, we explicitly check that when parsing integers in the URI and error for out of range:&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/f34ff4aa6bc90c2f433be677b2b2f5fc74ff0ca6/src/libmongoc/src/mongoc/mongoc-uri.c#L776-L779&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/blob/f34ff4aa6bc90c2f433be677b2b2f5fc74ff0ca6/src/libmongoc/src/mongoc/mongoc-uri.c#L776-L779&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since there&apos;s no known need to set a wtimeout outside of the range of an int32, I don&apos;t think there&apos;s a reason to support int64 wtimeout in the URI. Plus, there is also a way to set an int64 wtimeout on the client, by using mongoc_client_set_write_concern.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Was it really necessary to deprecate the original functions? &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;No. But I think that&apos;s a fair argument. The 32 bit variants will work just as well for users. And I think not deprecating would be keeping in line with making the least destructive change. I&apos;ll comment in the review.&lt;/p&gt;</comment>
                            <comment id="2341630" author="haris.sheikh" created="Wed, 24 Jul 2019 15:14:29 +0000"  >&lt;blockquote&gt;&lt;p&gt; In _mongoc_uri_build_write_concern, the wtimeoutms variable is obtained with mongoc_uri_get_option_as_int32. I realize that &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3087&quot; title=&quot;Allow setting and getting of wtimeoutMS as an int64_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3087&quot;&gt;&lt;del&gt;CDRIVER-3087&lt;/del&gt;&lt;/a&gt; was not concerned with allowing a 64-bit integer to be set via the connection string, but I would like to confirm that mongoc_uri_get_option_as_int32 will properly ignore a value in that range. I&apos;ll note that a mongoc_uri_get_option_as_int64 function does not even exist.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jmikola&quot; class=&quot;user-hover&quot; rel=&quot;jmikola&quot;&gt;jmikola&lt;/a&gt; by properly ignore a value in that range do you mean that mongoc_uri_get_option_as_int32 should not somehow be able to set a 64-bit integer greater than INT32_MAX? Because I don&#8217;t see how that would be possible, but would you like me to add some sort of test to explicitly check that an attempt to provide a value above INT32_MAX will be ignored/raise an error?&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt; While mongoc_write_concern_new_from_iter was changed to accept a 64-bit integer _type, it still requires that it not exceed the range of a signed 32-bit integer. Was this the most minimum change to meet Kaitlin&apos;s previous request? Combined with _mongoc_write_concern_freeze, I would think that this still prevents Swift users from specifying 64-bit integers (see: SWIFT-395).&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I updated this to not enforce the range of a 32-bit integer, and updated the test-case that would have previously viewed this as incorrectly passing. The rest of the test suite seems to still pass (locally and on evergreen), but please let me know if this may have broken something or caused some unintended functionality.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;In test-conveniences.c and test-mongoc-read-write-concern.c, &lt;br/&gt;
 mongoc_write_concern_set_wtimeout_int64 is used with an argument received from bson_lookup_int32. Should bson_lookup_int64 have been used instead? This may be a non-concern if we&apos;re certain the values are all in the range of 32-bit integers.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;To my understanding these values are in the range of 32-bit integers, so I don&#8217;t see it being an issue, but I can update it if we want?&lt;/p&gt;

&lt;p&gt;And then in regards to deprecations, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kevin.albertson&quot; class=&quot;user-hover&quot; rel=&quot;kevin.albertson&quot;&gt;kevin.albertson&lt;/a&gt; previously suggested I should deprecate both the setters and getters to encourage users to switch over to the new _int64 versions, as there is no significant reason not to. However, I don&#8217;t have a strong opinion on either option, so I can remove the deprecations on either or leave them as is depending on whatever you think is best.&lt;/p&gt;

&lt;p&gt;Otherwise I think I fixed all of the issues you raised and have put up the patch for code review. Please take a look though in case I missed anything, and thanks for noticing these issues in the first place!&lt;/p&gt;</comment>
                            <comment id="2331235" author="jmikola@gmail.com" created="Wed, 17 Jul 2019 22:08:12 +0000"  >&lt;blockquote&gt;
&lt;p&gt;In create_commit_retry_wc, mongoc_write_concern_get_wtimeout_int64 is used to fetch the value into a local int32_t wtimeout variable. That variable is then passed to mongoc_write_concern_set_wmajority, which expects an int32_t. This seemingly conflits with the spec language quoted within create_commit_retry_wc:&lt;/p&gt;

&lt;p&gt;any other write concern options MUST be left as-is when applying w:majority.&lt;/p&gt;

&lt;p&gt;A wtimeout value in the range of a 64-bit integer will end up truncated. This begs the question of whether a new mongoc_write_concern_set_wmajority method should have been created to complement mongoc_write_concern_set_wtimeout_int64.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Something that occurred to me while upgrading PHP (&lt;a href=&quot;https://jira.mongodb.org/browse/PHPC-1369&quot; title=&quot;Upgrade libmongoc to 1.15.0&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PHPC-1369&quot;&gt;&lt;del&gt;PHPC-1369&lt;/del&gt;&lt;/a&gt;) is that one could just use mongoc_write_concern_set_w with MONGOC_WRITE_CONCERN_W_MAJORITY to assign &lt;tt&gt;w:majority&lt;/tt&gt; without inadvertently modifying wtimeoutms. I&apos;m not sure why we never did this previously, as mongoc_write_concern_set_w has historically accepted any &lt;tt&gt;w&lt;/tt&gt; value &amp;gt;= 3 (this excludes only the -4 constant when &lt;tt&gt;w&lt;/tt&gt; is a custom tag string).&lt;/p&gt;

&lt;p&gt;If that sounds viable, then perhaps create_commit_retry_wc can just be modified to use mongoc_write_concern_set_w instead when addressing this ticket.&lt;/p&gt;</comment>
                            <comment id="2331141" author="jmikola@gmail.com" created="Wed, 17 Jul 2019 20:53:48 +0000"  >&lt;p&gt;While integrating this into PHPC, I came across a few issues that I think warrant re-opening this ticket.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Codeformatting&quot;&gt;&lt;/a&gt;Code formatting&lt;/h3&gt;

&lt;p&gt;Was code formatting applied to mongoc-write-concern.c after the change? There are a few cases where it looks like indentation is not aligned correctly (see: &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/943adca2630ee7d6e9196c5cd683afda6d8df3de#diff-69e203f1bea1cae2c7307e410778588eR226&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/943adca2630ee7d6e9196c5cd683afda6d8df3de#diff-69e203f1bea1cae2c7307e410778588eR226&lt;/a&gt;).&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Missingdocumentation&quot;&gt;&lt;/a&gt;Missing documentation&lt;/h3&gt;

&lt;p&gt;The commit introduced two new methods (mongoc_write_concern_set_wtimeout_int64 and mongoc_write_concern_get_wtimeout_int64), but they are not documented.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;mongocwriteconcernfreeze&quot;&gt;&lt;/a&gt;_mongoc_write_concern_freeze&lt;/h3&gt;

&lt;p&gt;_mongoc_write_concern_freeze still appends a non-zero &lt;tt&gt;write_concern-&amp;gt;wtimeout&lt;/tt&gt; value using bson_append_int32. This suggests that any value outside the range of a signed 32-bit integer will be truncated, and likely defeats the purpose of introducing an int64_t setter. I think this should be bson_append_int64. When fixing this, we should add a regression test to demonstrate that a 64-bit wtimeoutms value is properly preserved.&lt;/p&gt;


&lt;h3&gt;&lt;a name=&quot;createcommitretrywc&quot;&gt;&lt;/a&gt;create_commit_retry_wc&lt;/h3&gt;

&lt;p&gt;In &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/943adca2630ee7d6e9196c5cd683afda6d8df3de#diff-91cd8e36deedd69a30429653c94077d4R174&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;create_commit_retry_wc&lt;/a&gt;, mongoc_write_concern_get_wtimeout_int64 is used to fetch the value into a local &lt;tt&gt;int32_t wtimeout&lt;/tt&gt; variable. That variable is then passed to mongoc_write_concern_set_wmajority, which expects an int32_t. This seemingly conflits with the spec language quoted within create_commit_retry_wc:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;any other write concern options MUST be left as-is when applying w:majority.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;A wtimeout value in the range of a 64-bit integer will end up truncated. This begs the question of whether a new mongoc_write_concern_set_wmajority method should have been created to complement mongoc_write_concern_set_wtimeout_int64.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;mongocuribuildwriteconcern&quot;&gt;&lt;/a&gt;_mongoc_uri_build_write_concern&lt;/h3&gt;

&lt;p&gt;In &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/943adca2630ee7d6e9196c5cd683afda6d8df3de#diff-8bdfe834dc6bd6ab62ce08b7d3878649R1567&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;_mongoc_uri_build_write_concern&lt;/a&gt;, the &lt;tt&gt;wtimeoutms&lt;/tt&gt; variable is obtained with &lt;tt&gt;mongoc_uri_get_option_as_int32&lt;/tt&gt;. I realize that &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3087&quot; title=&quot;Allow setting and getting of wtimeoutMS as an int64_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3087&quot;&gt;&lt;del&gt;CDRIVER-3087&lt;/del&gt;&lt;/a&gt; was not concerned with allowing a 64-bit integer to be set via the connection string, but I would like to confirm that mongoc_uri_get_option_as_int32 will properly ignore a value in that range. I&apos;ll note that a mongoc_uri_get_option_as_int64 function does not even exist.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;mongocwriteconcernnewfromiter&quot;&gt;&lt;/a&gt;_mongoc_write_concern_new_from_iter&lt;/h3&gt;

&lt;p&gt;While &lt;em&gt;mongoc_write_concern_new_from_iter was changed to accept a 64-bit integer _type&lt;/em&gt;, it still requires that it not exceed the &lt;em&gt;range&lt;/em&gt; of a signed 32-bit integer. Was this the most minimum change to meet &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3087?focusedCommentId=2269640&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-2269640&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;Kaitlin&apos;s previous request&lt;/a&gt;? Combined with _mongoc_write_concern_freeze, I would think that this still prevents Swift users from specifying 64-bit integers (see: SWIFT-395).&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Testfiles&quot;&gt;&lt;/a&gt;Test files&lt;/h3&gt;

&lt;p&gt;In &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/943adca2630ee7d6e9196c5cd683afda6d8df3de#diff-085dc88fb33de4c50dfb54a0b3d80bd7R345&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;test-conveniences.c&lt;/a&gt; and &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/943adca2630ee7d6e9196c5cd683afda6d8df3de#diff-98744d0b1bbcfb6b66c9efd9b7ee5212R60&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;test-mongoc-read-write-concern.c&lt;/a&gt;, &lt;br/&gt;
mongoc_write_concern_set_wtimeout_int64 is used with an argument received from bson_lookup_int32. Should bson_lookup_int64 have been used instead? This may be a non-concern if we&apos;re certain the values are all in the range of 32-bit integers.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/943adca2630ee7d6e9196c5cd683afda6d8df3de#diff-fc8551ea277e49120e551b494f84d6fcR408&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;test-mongoc-write-concern.c&lt;/a&gt; is using BEGIN and END_IGNORE_DEPRECATIONS to call mongoc_write_concern_set_wtimeout. Is this the only remaining call to that method? Is there a particular reason this wasn&apos;t changed to use mongoc_write_concern_set_wtimeout_int64? If we wanted test coverage for the original method, I think it&apos;d be preferable to do so within &lt;tt&gt;test_write_concern_basic&lt;/tt&gt; earlier in the file (using the same syntax to ignore deprecations for a block of code).&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Deprecations&quot;&gt;&lt;/a&gt;Deprecations&lt;/h3&gt;

&lt;p&gt;Was it really necessary to deprecate the original functions? There may be an argument for doing so with mongoc_write_concern_get_wtimeout, since it could inadvertently truncate a result, but I think the various setters that accept an int32_t type for wtimeoutms are still fine to use for applications that have no need for larger values (which is most everyone).&lt;/p&gt;

&lt;p&gt;There may be an argument for leaving mongoc_write_concern_get_wtimeout alone and not deprecated. Since this likely affects to few applications, I think we could get by with some documentation that informs users a 64-bit value will be truncated to the int32_t return type and suggest they use the int64_t getter if that will be a concern.&lt;/p&gt;</comment>
                            <comment id="2299075" author="xgen-internal-githook" created="Wed, 26 Jun 2019 21:37:41 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Haris Sheikh&apos;, &apos;email&apos;: &apos;harissheikh@Hariss-MacBook-Pro.local&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3087&quot; title=&quot;Allow setting and getting of wtimeoutMS as an int64_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3087&quot;&gt;&lt;del&gt;CDRIVER-3087&lt;/del&gt;&lt;/a&gt; allow setting and getting of wtimeout as int64&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/943adca2630ee7d6e9196c5cd683afda6d8df3de&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/943adca2630ee7d6e9196c5cd683afda6d8df3de&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2296689" author="xgen-internal-githook" created="Tue, 25 Jun 2019 15:21:22 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kevin Albertson&apos;, &apos;username&apos;: &apos;kevinAlbs&apos;, &apos;email&apos;: &apos;kevin.albertson@mongodb.com&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3087&quot; title=&quot;Allow setting and getting of wtimeoutMS as an int64_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3087&quot;&gt;&lt;del&gt;CDRIVER-3087&lt;/del&gt;&lt;/a&gt; allow setting and getting of wtimeout as int64&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit e06044caa14a0ad431209de58460b3ba6a1c3b58.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/526e49b1f1ca074a920dac07a2f30850a3a8a2cd&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/526e49b1f1ca074a920dac07a2f30850a3a8a2cd&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2293636" author="xgen-internal-githook" created="Fri, 21 Jun 2019 20:52:01 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Haris Sheikh&apos;, &apos;email&apos;: &apos;harissheikh@Hariss-MacBook-Pro.local&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3087&quot; title=&quot;Allow setting and getting of wtimeoutMS as an int64_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3087&quot;&gt;&lt;del&gt;CDRIVER-3087&lt;/del&gt;&lt;/a&gt; allow setting and getting of wtimeout as int64&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/e06044caa14a0ad431209de58460b3ba6a1c3b58&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/e06044caa14a0ad431209de58460b3ba6a1c3b58&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2269640" author="kaitlin.mahar" created="Mon, 3 Jun 2019 21:07:59 +0000"  >&lt;p&gt;Apologies for only bringing this up now that the ticket is in code review, but in some places in the Swift driver we send libmongoc a write concern document embedded in an options document, for example&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;writeConcern&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;: {&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;wtimeout&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #009900; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;Currently in those cases, if wtimeout is an Int64, libmongoc gives an invalid write concern error.&lt;/p&gt;

&lt;p&gt;If it hasn&apos;t already been done, it would be very helpful to us if the code for parsing a WriteConcern from a document would also accept an Int64 being used in the document for wtimeout.&#160;&lt;/p&gt;</comment>
                            <comment id="2221384" author="kevin.albertson" created="Tue, 23 Apr 2019 02:00:27 +0000"  >&lt;p&gt;Thanks for checking if a spec change was warranted. I can&apos;t imagine a use case for a wtimeout of &amp;gt; 49 days, but who knows, maybe wtimeout will have special values in the future. For the sake of spec consistency I suppose there&apos;s no harm in adding get|set_wtimeout_int64.&lt;/p&gt;</comment>
                            <comment id="2221251" author="patrick.freed" created="Mon, 22 Apr 2019 21:55:08 +0000"  >&lt;p&gt;So it seems the spec change won&apos;t be happening, and that the C driver is exempt from adhering to it (results of SPEC-1282). Is there any possibility an overload of the function that operates on &lt;tt&gt;int64_t&lt;/tt&gt; s is added?&lt;/p&gt;</comment>
                            <comment id="2220580" author="patrick.freed" created="Mon, 22 Apr 2019 15:35:57 +0000"  >&lt;p&gt;We could do the same validation, but it doesn&apos;t get around the issue that the spec dictates that our api should accept an int64 that we have no way of actually setting properly. I agree that such a large timeout is unlikely, so I&apos;ve filed SPEC-1282 to discuss expanding the api to allow 32-bit integers. &lt;/p&gt;</comment>
                            <comment id="2220519" author="kevin.albertson" created="Mon, 22 Apr 2019 14:58:25 +0000"  >&lt;p&gt;PHP already validates that wtimeout is in the range of a 32 bit integer before calling get|set_wtimeout. Can we do the same in swift? Needing a timeout larger than what a 32 bit integer can hold seems very unlikely. This might warrant a spec change to accept both 32/64 bit integers.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="860216">PHPC-1411</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="974064">CDRIVER-3396</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <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|huk65j:</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>