<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:15:22 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-2483] _mongoc_async_cmd_phase_send may not send entire message</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-2483</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;The function &lt;tt&gt;_mongoc_async_cmd_phase_send&lt;/tt&gt; sends an ismaster command to the node it&apos;s checking. It uses &lt;tt&gt;mongoc_stream_writev&lt;/tt&gt; to send the message.&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/1.9.2/src/mongoc/mongoc-async-cmd.c#L248&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/blob/1.9.2/src/mongoc/mongoc-async-cmd.c#L248&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, &lt;tt&gt;mongoc_stream_writev&lt;/tt&gt; is not guaranteed to send the entire message of the iovec. If you jerry-rig an ismaster command with fake fields (which mongo doesn&apos;t mind) to increase the size of the ismaster command to something like 1MB, it will not send the full command and timeout checking. The repro.patch file is a simple way to reproduce this.&lt;/p&gt;

&lt;p&gt;It&apos;s unlikely we&apos;d ever hit this, since an ismaster message should be small enough never to be broken up on any reasonable system. But I think a reasonable and simple fix is to use &lt;tt&gt;_mongoc_stream_writev_full&lt;/tt&gt; instead, which sets an error if it cannot send the full message in one call to &lt;tt&gt;stream-&amp;gt;write&lt;/tt&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="490311">CDRIVER-2483</key>
            <summary>_mongoc_async_cmd_phase_send may not send entire message</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</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="kevin.albertson@mongodb.com">Kevin Albertson</assignee>
                                    <reporter username="kevin.albertson@mongodb.com">Kevin Albertson</reporter>
                        <labels>
                    </labels>
                <created>Wed, 31 Jan 2018 17:36:45 +0000</created>
                <updated>Sat, 28 Oct 2023 11:30:09 +0000</updated>
                            <resolved>Mon, 12 Feb 2018 19:13:00 +0000</resolved>
                                    <version>1.9.2</version>
                                    <fixVersion>1.10.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1795695" author="xgen-internal-githook" created="Mon, 5 Feb 2018 20:12:58 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;kevin.albertson@10gen.com&apos;, &apos;name&apos;: &apos;Kevin Albertson&apos;, &apos;username&apos;: &apos;kevinAlbs&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2483&quot; title=&quot;_mongoc_async_cmd_phase_send may not send entire message&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2483&quot;&gt;&lt;del&gt;CDRIVER-2483&lt;/del&gt;&lt;/a&gt; fix large ismaster test for windows&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/3d8933891be82c9d33f2d5a3f9ceeb0b4bef0b59&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/3d8933891be82c9d33f2d5a3f9ceeb0b4bef0b59&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1795317" author="xgen-internal-githook" created="Mon, 5 Feb 2018 16:40:15 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;kevin.albertson@10gen.com&apos;, &apos;name&apos;: &apos;Kevin Albertson&apos;, &apos;username&apos;: &apos;kevinAlbs&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2483&quot; title=&quot;_mongoc_async_cmd_phase_send may not send entire message&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2483&quot;&gt;&lt;del&gt;CDRIVER-2483&lt;/del&gt;&lt;/a&gt; send entire ismaster message&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/bc9c76e22576813c1553eef1e4e38e6dbb5f6c4c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/bc9c76e22576813c1553eef1e4e38e6dbb5f6c4c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1790966" author="jesse" created="Wed, 31 Jan 2018 19:12:28 +0000"  >&lt;p&gt;Let&apos;s try instead to call mongoc_stream_writev in _mongoc_async_cmd_phase_send as we currently do but, if the bytes sent is less than the total outgoing message, &lt;b&gt;don&apos;t&lt;/b&gt; change the async_cmd_t&apos;s state. Then the event loop in mongoc_async_run should call _mongoc_async_cmd_phase_send again once the socket is writable (its events match the POLLOUT bitmask) and _mongoc_async_cmd_phase_send can send more bytes.&lt;/p&gt;

&lt;p&gt;I agree that, so far, we haven&apos;t seen any circumstances where the socket&apos;s write buffer is too small to send a whole isMaster in one shot. But if we&apos;re going to change this code we might as well do a fully correct solution that can handle any size of write buffer and message size.&lt;/p&gt;</comment>
                    </comments>
                    <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|htgsjb:</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>