<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:20: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-4184] Assert in invalid topology in load balanced mode topology closed callback</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-4184</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;&lt;b&gt;Background &amp;amp; Motivation&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/b2e1ae0552e1853e981fd488e8ad5039292500ef/src/libmongoc/src/mongoc/mongoc-topology-description-apm.c#L183&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;This assertion&lt;/a&gt; is hit in &lt;tt&gt;mongoc_client_pool_destroy&lt;/tt&gt; under these conditions:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;The topology type is LoadBalanced&lt;/li&gt;
	&lt;li&gt;The topology description fails to add the LoadBalancer server.&lt;/li&gt;
	&lt;li&gt;A TopologyClosed callback is set.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-4145&quot; title=&quot;Do not start background monitoring when topology is invalid&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-4145&quot;&gt;&lt;del&gt;CDRIVER-4145&lt;/del&gt;&lt;/a&gt; fixed a similar assertion on the TopologyOpening event. The solution was to not emit a TopologyOpening event if the topology is marked invalid (i.e. a failure to resolve any hosts, or invalid options applied through TXT lookup).&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Reproducing&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;This can be reproduced by modifying the &lt;tt&gt;_test_dns_maybe_pooled&lt;/tt&gt; function to set a topology closed callback with &lt;tt&gt;mongoc_apm_set_topology_closed_cb&lt;/tt&gt; and running the test &lt;a href=&quot;https://github.com/mongodb/specifications/blob/1ff5fac58373ec7e41ef2150eae1f3d50938e0e9/source/initial-dns-seedlist-discovery/tests/load-balanced/loadBalanced-replicaSet-errors.yml&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;loadBalanced-replicaSet-errors&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Scope&lt;/b&gt;&lt;br/&gt;
Do not emit a TopologyClosed event if the topology is marked invalid. A TopologyOpening event is already not emitted in this case.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1895816">CDRIVER-4184</key>
            <summary>Assert in invalid topology in load balanced mode topology closed callback</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="kevin.albertson@mongodb.com">Kevin Albertson</assignee>
                                    <reporter username="kevin.albertson@mongodb.com">Kevin Albertson</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 Oct 2021 03:39:14 +0000</created>
                <updated>Sat, 28 Oct 2023 11:28:18 +0000</updated>
                            <resolved>Tue, 2 Nov 2021 21:05:31 +0000</resolved>
                                                    <fixVersion>1.19.2</fixVersion>
                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="4274877" author="xgen-internal-githook" created="Tue, 4 Jan 2022 20:02:35 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jeremy Mikola&apos;, &apos;email&apos;: &apos;jmikola@gmail.com&apos;, &apos;username&apos;: &apos;jmikola&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3723&quot; title=&quot;Validate URI options on client/client pool creation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3723&quot;&gt;&lt;del&gt;CDRIVER-3723&lt;/del&gt;&lt;/a&gt; finalize URI during client/pool construction (#921)&lt;/p&gt;

&lt;p&gt;Introduces new mongoc_client_new_from_uri_with_error and mongoc_client_pool_new_with_error methods. Also addresses topology leak in mongoc_client_new_from_uri (&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-4251&quot; title=&quot;mongoc_client_new_from_uri may leak topology&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-4251&quot;&gt;&lt;del&gt;CDRIVER-4251&lt;/del&gt;&lt;/a&gt;).&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Remove redundant warnings about unused results&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Explain why we need not handle null result from _mongoc_client_new_from_topology&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Log URI errors in mongoc_client_new as warnings&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Clear logs between /Client/max_staleness assertions&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Set error instead of logging in mongoc_client_pool_new_with_error&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Remove test expecting a client with an invalid topology&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Revise assertions in /loadbalanced/client_uri_validation test&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This no longer requires constructing a client and expecting an error through server selection.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Use tracing macro for return statement&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Check MONGOC_ENABLE_SSL in mongoc_client_new_from_uri_with_error&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Moving the check up from _mongoc_client_new_from_topology makes mongoc_client_new_from_uri_with_error consistent with mongoc_client_pool_new_with_error. Additionally, we add log message assertions to corresponding tests.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Anticipate null pool or client in SRV error tests&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Remove obsolete tests for invalid LB topologies&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;These tests were previously introduced in &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-4184&quot; title=&quot;Assert in invalid topology in load balanced mode topology closed callback&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-4184&quot;&gt;&lt;del&gt;CDRIVER-4184&lt;/del&gt;&lt;/a&gt; but no longer apply now that we prohibit construction of clients and pools with an invalid topology.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;_mongoc_client_new_from_topology should require a valid topology&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Document precondition for _mongoc_client_new_from_topology&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Co-authored-by: Ezra Chung &amp;lt;88335979+eramongodb@users.noreply.github.com&amp;gt;&lt;br/&gt;
Co-authored-by: Kevin Albertson &amp;lt;kevin.albertson@mongodb.com&amp;gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/e7e15002d63cb57424f467c5f21eafa9ec0f018e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/e7e15002d63cb57424f467c5f21eafa9ec0f018e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4165210" author="xgen-internal-githook" created="Tue, 2 Nov 2021 21:05:09 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kevin Albertson&apos;, &apos;email&apos;: &apos;kevin.albertson@mongodb.com&apos;, &apos;username&apos;: &apos;kevinAlbs&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-4184&quot; title=&quot;Assert in invalid topology in load balanced mode topology closed callback&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-4184&quot;&gt;&lt;del&gt;CDRIVER-4184&lt;/del&gt;&lt;/a&gt; don&apos;t emit closed on invalid topology (#884)&lt;br/&gt;
Branch: r1.19&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/2d944671703171165b4505cdfef55450f2cf0fa0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/2d944671703171165b4505cdfef55450f2cf0fa0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4165205" author="xgen-internal-githook" created="Tue, 2 Nov 2021 21:03:46 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kevin Albertson&apos;, &apos;email&apos;: &apos;kevin.albertson@mongodb.com&apos;, &apos;username&apos;: &apos;kevinAlbs&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-4184&quot; title=&quot;Assert in invalid topology in load balanced mode topology closed callback&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-4184&quot;&gt;&lt;del&gt;CDRIVER-4184&lt;/del&gt;&lt;/a&gt; don&apos;t emit closed on invalid topology (#884)&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/b93e345178a3a50352894b4be300928987f3d371&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/b93e345178a3a50352894b4be300928987f3d371&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4159375" author="kevin.albertson" created="Sun, 31 Oct 2021 16:27:16 +0000"  >&lt;p&gt;PR: &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/pull/884&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/pull/884&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1956981">CDRIVER-4254</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1865758">CDRIVER-4145</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </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|hr6igv:</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>