<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:17:39 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-3306] Do not assume non-empty server reply implies stream is still valid</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-3306</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;UPDATE: This ticket has been cloned so that the clone will cover Scenario 1 (as described by Kevin&apos;s comment from 03/09/2020) and this original ticket will cover Scenario 2 (as described in the aforementioned comment).&lt;/p&gt;

&lt;p&gt;A mongoc_server_stream_t should not be reused after calling &lt;tt&gt;mongoc_cluster_run_command_monitored&lt;/tt&gt; on with the stream.&lt;/p&gt;

&lt;p&gt;In two situations, the stream will disconnect and be invalidated:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;a network error (&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/49a55e0966d599e09b702df5ae570e11ca23c1df/src/libmongoc/src/mongoc/mongoc-cluster.c#L277&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;example&lt;/a&gt;)&lt;/li&gt;
	&lt;li&gt;a &quot;not master&quot; or &quot;node is recovering error&quot; for pre 4.2 server (&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/49a55e0966d599e09b702df5ae570e11ca23c1df/src/libmongoc/src/mongoc/mongoc-cluster.c#L478-L481&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;When that happens, the server_stream for that operation is no longer valid. But we do not always account that correctly. &lt;/p&gt;

&lt;p&gt;_mongoc_write_opmsg (incorrectly) always ends unordered bulk operations on error because of &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3305&quot; title=&quot;OP_MSG unordered bulk writes should not stop upon first error&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3305&quot;&gt;&lt;del&gt;CDRIVER-3305&lt;/del&gt;&lt;/a&gt;. Once that is resolved, it will need to handle the case of an invalidated server stream.&lt;/p&gt;

&lt;p&gt;_mongoc_write_opquery &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/49a55e0966d599e09b702df5ae570e11ca23c1df/src/libmongoc/src/mongoc/mongoc-write-command.c#L805-L811&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;only sets must_stop to true&lt;/a&gt; for what it deems is a network error (of which, that check might not be quite right if error labels were applied). But it does not handle the case of a &quot;not master&quot; or &quot;node is recovering&quot; error causing a disconnect.&lt;/p&gt;</description>
                <environment></environment>
        <key id="890712">CDRIVER-3306</key>
            <summary>Do not assume non-empty server reply implies stream is still valid</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="roberto.sanchez@mongodb.com">Roberto Sanchez</assignee>
                                    <reporter username="kevin.albertson@mongodb.com">Kevin Albertson</reporter>
                        <labels>
                    </labels>
                <created>Sun, 11 Aug 2019 17:47:39 +0000</created>
                <updated>Sat, 28 Oct 2023 11:29:10 +0000</updated>
                            <resolved>Tue, 31 Mar 2020 19:51:03 +0000</resolved>
                                                    <fixVersion>1.17.0-beta</fixVersion>
                    <fixVersion>1.17.0</fixVersion>
                                    <component>Bulk API</component>
                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="3019911" author="xgen-internal-githook" created="Tue, 31 Mar 2020 19:50:43 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Roberto C. S&#225;nchez&apos;, &apos;email&apos;: &apos;roberto@connexer.com&apos;, &apos;username&apos;: &apos;rcsanchez97&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3306&quot; title=&quot;Do not assume non-empty server reply implies stream is still valid&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3306&quot;&gt;&lt;del&gt;CDRIVER-3306&lt;/del&gt;&lt;/a&gt; non-empty server reply does not imply valid stream&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/6ad0608fc5c8faf03bf20286946886e5e32191e0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/6ad0608fc5c8faf03bf20286946886e5e32191e0&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10720">
                    <name>Cloners</name>
                                                                <inwardlinks description="is cloned by">
                                        <issuelink>
            <issuekey id="1286960">CDRIVER-3587</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10020">
                    <name>Gantt Dependency</name>
                                            <outwardlinks description="has to be done before">
                                        <issuelink>
            <issuekey id="890711">CDRIVER-3305</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="857698">CDRIVER-3239</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|hv8z1b:</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>