<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:20:24 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-4251] mongoc_client_new_from_uri may leak topology</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-4251</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;In &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/1.20.0/src/libmongoc/src/mongoc/mongoc-client.c#L1023&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;mongoc_client_new&lt;/tt&gt;&lt;/a&gt;, the topology is freed before returning NULL. The same does not happen in &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/1.20.0/src/libmongoc/src/mongoc/mongoc-client.c#L1114&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;mongoc_client_new_from_uri&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This can be addressed alongside &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;, since that ticket will refactor both methods alongside introduction of a new &lt;tt&gt;mongoc_client_new_from_uri_with_error&lt;/tt&gt; method.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1956001">CDRIVER-4251</key>
            <summary>mongoc_client_new_from_uri may leak topology</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="jmikola@mongodb.com">Jeremy Mikola</assignee>
                                    <reporter username="jmikola@mongodb.com">Jeremy Mikola</reporter>
                        <labels>
                    </labels>
                <created>Thu, 23 Dec 2021 15:47:45 +0000</created>
                <updated>Sat, 28 Oct 2023 11:28:14 +0000</updated>
                            <resolved>Tue, 4 Jan 2022 20:02:58 +0000</resolved>
                                                    <fixVersion>1.21.0</fixVersion>
                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="4274878" author="xgen-internal-githook" created="Tue, 4 Jan 2022 20:02:38 +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="4266461" author="jmikola@gmail.com" created="Thu, 23 Dec 2021 19:31:34 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/pull/921&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/pull/921&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1384145">CDRIVER-3723</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|hzyp8v:</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>