<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:19:58 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-4113] Reduce contention on multithreaded session pool</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-4113</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;The &lt;tt&gt;session_pool&lt;/tt&gt; in &lt;tt&gt;mongoc_topology_t&lt;/tt&gt; is shared between threads and guarded by &lt;tt&gt;mongoc_topology_t::mutex&lt;/tt&gt;, which is also locked by numerous other operations.&lt;/p&gt;

&lt;p&gt;When a session is requested from the pool, the requesting thread will lock the mutex and loop through every entry in the pool and remove sessions that are alive past their timeout. This can extremely produce latency as the pool grows. Because the same mutex is shared by multiple (some unrelated) operations, this operation blocks almost all clients.&lt;/p&gt;

&lt;p&gt;The process of dropping expired sessions need not be performed every single time we want a session from the pool, and holding the lock while performing this garbage collection is extremely detrimental.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1839210">CDRIVER-4113</key>
            <summary>Reduce contention on multithreaded session pool</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</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="colby.pike@mongodb.com">Colby Pike</assignee>
                                    <reporter username="colby.pike@mongodb.com">Colby Pike</reporter>
                        <labels>
                    </labels>
                <created>Tue, 3 Aug 2021 00:25:19 +0000</created>
                <updated>Sat, 28 Oct 2023 11:28:21 +0000</updated>
                            <resolved>Mon, 13 Sep 2021 21:33:54 +0000</resolved>
                                                    <fixVersion>1.20.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="4054929" author="xgen-internal-githook" created="Mon, 13 Sep 2021 20:18:50 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;vector-of-bool&apos;, &apos;email&apos;: &apos;vectorofbool@gmail.com&apos;, &apos;username&apos;: &apos;vector-of-bool&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-4113&quot; title=&quot;Reduce contention on multithreaded session pool&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-4113&quot;&gt;&lt;del&gt;CDRIVER-4113&lt;/del&gt;&lt;/a&gt;: Thread-safe pool for server session objects (#847)&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;CXX-4113: Thread-safe pool for server session objects&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Remove unused node pointers on server sessions&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Track pool size, and don&apos;t loop while holding the lock to clear&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Cleanup and some redesign of pool API&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Declare special pool for server sessions&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Mention the LIFO nature of the thread-pool, and the non-conformance of the &apos;push&apos; operation&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;auditing the pool is compile-time optional&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Remove -Waggregate-return&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/9a0ab6cfdf94e5f1807533cdf9170116502ecd32&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/9a0ab6cfdf94e5f1807533cdf9170116502ecd32&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1846653">CDRIVER-4124</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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>CDRIVER-4002</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hzdc67:</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>