<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:18:12 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-3491] mongoc_client_reset should reset key vault client</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-3491</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;A &lt;tt&gt;mongoc_client_t&lt;/tt&gt; with automatic encryption (set via &lt;tt&gt;mongoc_client_enable_auto_encryption()&lt;/tt&gt;) may use a separate inner &lt;tt&gt;mongoc_client_t&lt;/tt&gt; passed via &lt;tt&gt;mongoc_auto_encryption_opts_set_keyvault_client&lt;/tt&gt; to communicate with the key vault. Calling &lt;tt&gt;mongoc_client_reset&lt;/tt&gt; should also reset the inner &lt;tt&gt;mongoc_client_t&lt;/tt&gt; used to communicate with the key vault. Otherwise, the inner key vault client could end up reusing sessions from its own session pool.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1101764">CDRIVER-3491</key>
            <summary>mongoc_client_reset should reset key vault client</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="12300">Won&apos;t Do</resolution>
                                        <assignee username="kevin.albertson@mongodb.com">Kevin Albertson</assignee>
                                    <reporter username="kevin.albertson@mongodb.com">Kevin Albertson</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 Jan 2020 16:42:24 +0000</created>
                <updated>Mon, 10 Feb 2020 15:37:48 +0000</updated>
                            <resolved>Mon, 10 Feb 2020 15:37:48 +0000</resolved>
                                                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="2777457" author="jmikola@gmail.com" created="Fri, 31 Jan 2020 19:27:48 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=andreas.braun&quot; class=&quot;user-hover&quot; rel=&quot;andreas.braun&quot;&gt;andreas.braun&lt;/a&gt;: I&apos;m thinking of ways that PHPC could reset its key vault client automatically when the application&apos;s main client is reset. Storing a reference to the key vault &lt;tt&gt;mongoc_client_t&lt;/tt&gt; on a Manager wouldn&apos;t help, since our Session and Cursor classes have direct references to a &lt;tt&gt;mongoc_client_t&lt;/tt&gt; instead of an indirect reference through the Manager object. That said, if our list of persisted clients also associates a PID with each client, perhaps we can tweak our reset logic to iterate on that list and reset anything that wasn&apos;t created by the current PID (would catch an otherwise unused key vault client) and hasn&apos;t already been reset by the current PID (to avoid double resets).&lt;/p&gt;</comment>
                            <comment id="2774123" author="kevin.albertson" created="Thu, 30 Jan 2020 23:07:00 +0000"  >&lt;p&gt;For libmongoc, we already require the user to keep a handle to the key vault client so they can &lt;tt&gt;mongoc_client_destroy&lt;/tt&gt; it later. Perhaps it is reasonable to just document that a user must &lt;tt&gt;mongoc_client_reset&lt;/tt&gt; that client upon forking instead of resetting twice?&lt;/p&gt;

&lt;p&gt;But I&apos;m less familiar with how this works in regards to PHP. If it would make the PHP implementation easier, that&apos;s reason enough to reset the key vault client. I don&apos;t &lt;em&gt;think&lt;/em&gt; the risk of double resetting is an issue. If a user were to call &lt;tt&gt;mongoc_client_reset&lt;/tt&gt; on the key vault client in direct succession, then no new resources would have been created in between the two resets, so there&apos;d be no orphaned resources.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&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; let me know if you think this is a change worthwhile to implement, or if it would help with PHP. Otherwise, I&apos;d vote to make this a docs only change.&lt;/p&gt;</comment>
                            <comment id="2739573" author="jmikola@gmail.com" created="Fri, 17 Jan 2020 17:51:57 +0000"  >&lt;p&gt;To clarify, we definitely don&apos;t want to reset the key vault client if it&apos;s identical to the application client (where FLE has been enabled).&lt;/p&gt;

&lt;p&gt;With respect to a separate key vault client, it is possible that the application would still have a reference to it and might call &lt;tt&gt;mongoc_client_reset()&lt;/tt&gt; on &lt;em&gt;both&lt;/em&gt; the application and key vault clients. Before implementing this ticket, I think we should consider possible side effects of resetting a key vault client twice. This is something I was careful not to do in &lt;a href=&quot;https://jira.mongodb.org/browse/PHPC-1274&quot; title=&quot;Reset libmongoc client after forking to avoid interacting with parent resources in child processes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PHPC-1274&quot;&gt;&lt;del&gt;PHPC-1274&lt;/del&gt;&lt;/a&gt; to avoid orphaning resources in the child process (such that their generation would never match an active client and thus never get cleaned up); however, this might not be a concern if all of the resetting happens immediately and in succession. In that case, the only side effect would be that we increment the generation twice, but there would be no resources created between calls to &lt;tt&gt;mongoc_client_reset()&lt;/tt&gt; to potentially cause the issue I worked around in PHP.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1101771">PHPC-1529</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|hw7247:</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>