<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:19:09 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>[SERVER-28822] Improve DBConnectionPool&apos;s growth semantics</title>
                <link>https://jira.mongodb.org/browse/SERVER-28822</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The DBConnectionPool (legacy connection pool that backs dbclient, used for write operations through 3.5.x) has hard-to-understand and occasionally problematic growth semantics.&lt;/p&gt;

&lt;p&gt;Our documentation for the knob that controls this pool is correct:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Set the maximum size of the connection pools for outgoing connections to other mongod instances. The size of a pool does not prevent the creation of additional connections, but does prevent a connection pool from retaining connections in excess of the value of connPoolMaxConnsPerHost.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;However, it does not explain that connections retained in the pool will remain open in the pool forever, leading to a steady growth in long-lived outgoing server connections, then a plateau once the max pool size is reached, even when there is no load on the system.&lt;/p&gt;

&lt;p&gt;We could do the following things to improve DBConnectionPool&apos;s semantics and offer more control over its growth:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;add a &quot;MaxOpenConnections&quot; option that would cap the number of connections that are simultaneously created (not just retained) by DBConnectionPool.  For backwards compatibility this would default to infinity.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;add an &quot;IdleHostTimeoutMS&quot; option, so that DBConnectionPool dumps its connections to a host after this amount of time spent idle, instead of keeping them open forever.  For backwards compatibility this would default to &quot;no timeout.&quot;&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;strongly suggest that customers with large clusters or many mongos set the connPoolMaxConnsPerHost and connPoolMaxShardedConnsPerHost parameters to some number that is much smaller than the default of 200.&lt;/li&gt;
&lt;/ul&gt;

</description>
                <environment></environment>
        <key id="374632">SERVER-28822</key>
            <summary>Improve DBConnectionPool&apos;s growth semantics</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="9">Done</resolution>
                                        <assignee username="mira.carey@mongodb.com">Mira Carey</assignee>
                                    <reporter username="samantha.ritter@mongodb.com">Samantha Ritter</reporter>
                        <labels>
                    </labels>
                <created>Mon, 17 Apr 2017 15:16:58 +0000</created>
                <updated>Tue, 30 Oct 2018 03:49:08 +0000</updated>
                            <resolved>Thu, 1 Feb 2018 16:36:58 +0000</resolved>
                                                    <fixVersion>3.6.3</fixVersion>
                    <fixVersion>3.7.2</fixVersion>
                                    <component>Networking</component>
                                        <votes>1</votes>
                                    <watches>20</watches>
                                                                                                                <comments>
                            <comment id="1800800" author="xgen-internal-githook" created="Fri, 9 Feb 2018 15:29:12 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jcarey@argv.me&apos;, &apos;name&apos;: &apos;Jason Carey&apos;, &apos;username&apos;: &apos;hanumantmk&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28822&quot; title=&quot;Improve DBConnectionPool&amp;#39;s growth semantics&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-28822&quot;&gt;&lt;del&gt;SERVER-28822&lt;/del&gt;&lt;/a&gt; asan fixes&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 2f1773ed1edb357ff77144481803a9e6df9481de)&lt;br/&gt;
Branch: v3.6&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/5f51b55d63b57845c7573d9a4a7862c10149674b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5f51b55d63b57845c7573d9a4a7862c10149674b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1800799" author="xgen-internal-githook" created="Fri, 9 Feb 2018 15:29:11 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;samantha.ritter@10gen.com&apos;, &apos;name&apos;: &apos;samantharitter&apos;, &apos;username&apos;: &apos;samantharitter&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28822&quot; title=&quot;Improve DBConnectionPool&amp;#39;s growth semantics&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-28822&quot;&gt;&lt;del&gt;SERVER-28822&lt;/del&gt;&lt;/a&gt; Add new dbclient connection pool options&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 48a34a495386b7cbe18419313768929d12028125)&lt;br/&gt;
Branch: v3.6&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/3d46e7e05bed6c6f19a64007cc28c344deef9513&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/3d46e7e05bed6c6f19a64007cc28c344deef9513&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1798303" author="david.storch" created="Wed, 7 Feb 2018 17:18:13 +0000"  >&lt;p&gt;I&apos;m inclined to agree with Kal here. The query team&apos;s roadmap involves agg improvements which will make mapReduce obsolete rather than improvements to mapReduce.&lt;/p&gt;</comment>
                            <comment id="1798290" author="kaloian.manassiev" created="Wed, 7 Feb 2018 17:10:13 +0000"  >&lt;p&gt;I understand that, but on the other hand it causes us to do throwaway work to modernize M/R, which is pending deprecation in exchange for aggregation features.&lt;/p&gt;

&lt;p&gt;If we isolate the old connection pool to have only one user - M/R, when we get to removing it, we can just delete all that code at once. We can even consolidate it all in one M/R library so nobody can use it and just delete the entire library when the time comes.&lt;/p&gt;</comment>
                            <comment id="1798280" author="acm" created="Wed, 7 Feb 2018 17:06:08 +0000"  >&lt;p&gt;It will prevent us from removing a pile of old code we don&apos;t want to keep around.&lt;/p&gt;</comment>
                            <comment id="1798267" author="kaloian.manassiev" created="Wed, 7 Feb 2018 17:02:09 +0000"  >&lt;p&gt;Do we need to touch M/R at all? If we fix everything else and leave M/R as the only user of the legacy DBConnectionPool, then I don&apos;t think we need to worry about it&apos;s growth, because M/R is rarely used and if used is typically from a small number of connections and runs long time.&lt;/p&gt;</comment>
                            <comment id="1798217" author="esha.maharishi@10gen.com" created="Wed, 7 Feb 2018 16:48:29 +0000"  >&lt;p&gt;I wonder if the above could be a joint query-sharding intern project, e.g. two interns co-mentored by one person from query, one from sharding &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;CC &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=david.storch&quot; class=&quot;user-hover&quot; rel=&quot;david.storch&quot;&gt;david.storch&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kaloian.manassiev&quot; class=&quot;user-hover&quot; rel=&quot;kaloian.manassiev&quot;&gt;kaloian.manassiev&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1798211" author="esha.maharishi@10gen.com" created="Wed, 7 Feb 2018 16:46:04 +0000"  >&lt;p&gt;I think it&apos;d be useful to chop away at these one &quot;infrastructure pillar&quot; at a time, to allow deleting big chunks of the infrastructure until it&apos;s all gone.&lt;/p&gt;

&lt;p&gt;For sharding, I think the first goal should be to get rid of uses of ShardConnection, since that allows deleting all the connection versioning code (version_manager.cpp, ShardedConnectionInfo, a bunch of setShardVersion, parts of the ChunkManager).&lt;/p&gt;

&lt;p&gt;The biggest obstacle for this is the use of ParallelSortClusteredCursor in MapReduceFinishCommand (on the shards), since there is no good replacement for it (e.g., no way for shards to merge streams from other shards over ASIO).&lt;/p&gt;

&lt;p&gt;The sharded $lookup project would help a lot, by making the ARM usable on shards. In fact, it&apos;s a smaller project to make mapReduce use the ARM than to make $lookup use it, since mapReduce does not need to service client getMore&apos;s externally.&lt;/p&gt;</comment>
                            <comment id="1797230" author="esha.maharishi@10gen.com" created="Tue, 6 Feb 2018 20:20:56 +0000"  >&lt;p&gt;Update as of 3.7.1 (~February 2018) for remaining uses of legacy networking (&lt;font color=&quot;#f79232&quot;&gt;query&lt;/font&gt;, &lt;font color=&quot;#14892c&quot;&gt;replication&lt;/font&gt;, &lt;font color=&quot;#59afe1&quot;&gt;sharding&lt;/font&gt;).&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Look at just the bolded words for the major infrastructural pillars supported by legacy networking.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;uses &lt;b&gt;ShardConnection directly&lt;/b&gt;:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;MRCmd&lt;/font&gt; (mapReduce)&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;ClusterMergeChunksCommand&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;CmdShardingResetError&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#f79232&quot;&gt;GroupCmd::explain()&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;uses ShardConnection through &lt;b&gt;PublicGridCommand::passthrough()&lt;/b&gt; (these can be all be updated by just updating PublicGridCommand::passthrough()):&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;CollectionStats&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;CreateCmd&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;DataSizeCmd&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;EvalCmd&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;FileMD5Cmd&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#f79232&quot;&gt;Geo2dFindNearCmd&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;ValidateCmd&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;CopyDBCmd&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;RenameCollectionCmd&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;uses ShardConnection through &lt;b&gt;ParallelSortClusteredCursor directly&lt;/b&gt;:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;mapReduceFinishCommand&lt;/font&gt; (mapReduce phase 2, on shards)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;uses ParallelSortClusteredCursor through &lt;b&gt;Strategy::commandOp()&lt;/b&gt; (these can all be updated by just updating Strategy::commandOp()):&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font color=&quot;#f79232&quot;&gt;ClusterIndexFilterCmd&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#f79232&quot;&gt;ClusterPlanCacheCmd&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;MRCmd (mapReduce on mongos)&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;ValidateCmd&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;FileMD5Cmd&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;uses &lt;b&gt;ScopedDbConnection directly&lt;/b&gt;:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;font color=&quot;#f79232&quot;&gt;document_source_merge_cursors.cpp&lt;/font&gt; (aggregation&apos;s &apos;merging shard&apos; behavior on shards)&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;ConfigsvrMovePrimaryCommand&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;ConfigsvrShardCollectionCommand&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;MigrationDestinationManager::_migrateDriver&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#f79232&quot;&gt;cluster_aggregate.cpp::getDefaultCollationForUnshardedCollection()&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#f79232&quot;&gt;ClusterKillOpCommand&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;cluster_write.cpp::findExtremeKeyForShard()&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;CollectionStats&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;DataSizeCmd&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#14892c&quot;&gt;replication_info.cpp::appendReplicationInfo()&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;MrCmd::cleanUp()&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;ReplicaSetMonitor::_refreshUntilMatches()&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;uses ScopedDbConnection through &lt;b&gt;cursorCommandPassthrough()&lt;/b&gt; (on mongos):&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;CmdListCollections&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#59afe1&quot;&gt;CmdListIndexes&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;uses ScopedDbConnection through &lt;b&gt;DBClientCursor&lt;/b&gt;:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;DBClientBase::query()&lt;/li&gt;
	&lt;li&gt;DBClientBase::getMore()&lt;br/&gt;
&lt;em&gt;Note, there are uses of both these in all three of sharding, repl, and query&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;uses &lt;b&gt;DBClientConnection directly&lt;/b&gt;:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;font color=&quot;#14892c&quot;&gt;isSelf()&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#14892c&quot;&gt;OplogReader::connect()&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;uses DBClientConnection through &lt;b&gt;ConnectionPool::acquireConnection()&lt;/b&gt;:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;font color=&quot;#14892c&quot;&gt;BackgroundSync::_runRollback()&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Finally, note that DBClient is still used in mongobridge, benchrun, and the shell.&lt;/p&gt;</comment>
                            <comment id="1791917" author="xgen-internal-githook" created="Thu, 1 Feb 2018 16:36:32 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jcarey@argv.me&apos;, &apos;name&apos;: &apos;Jason Carey&apos;, &apos;username&apos;: &apos;hanumantmk&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28822&quot; title=&quot;Improve DBConnectionPool&amp;#39;s growth semantics&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-28822&quot;&gt;&lt;del&gt;SERVER-28822&lt;/del&gt;&lt;/a&gt; asan fixes&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/2f1773ed1edb357ff77144481803a9e6df9481de&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/2f1773ed1edb357ff77144481803a9e6df9481de&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1791916" author="xgen-internal-githook" created="Thu, 1 Feb 2018 16:36:30 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;samantha.ritter@10gen.com&apos;, &apos;name&apos;: &apos;samantharitter&apos;, &apos;username&apos;: &apos;samantharitter&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28822&quot; title=&quot;Improve DBConnectionPool&amp;#39;s growth semantics&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-28822&quot;&gt;&lt;del&gt;SERVER-28822&lt;/del&gt;&lt;/a&gt; Add new dbclient connection pool options&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/48a34a495386b7cbe18419313768929d12028125&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/48a34a495386b7cbe18419313768929d12028125&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1763128" author="xgen-internal-githook" created="Tue, 2 Jan 2018 18:36:13 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jason Carey&apos;, &apos;username&apos;: &apos;hanumantmk&apos;, &apos;email&apos;: &apos;jcarey@argv.me&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28822&quot; title=&quot;Improve DBConnectionPool&amp;#39;s growth semantics&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-28822&quot;&gt;&lt;del&gt;SERVER-28822&lt;/del&gt;&lt;/a&gt; Add new dbclient connection pool options&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit 9e7df79d3907a743e29b7333de6ea08a01f33a05.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/b48f6b016aa09aed2dec3b964ef982af8ab11a4c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/b48f6b016aa09aed2dec3b964ef982af8ab11a4c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1757288" author="samantha.ritter@10gen.com" created="Wed, 20 Dec 2017 21:43:51 +0000"  >&lt;p&gt;The above commit adds new options to the server:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;connPoolMaxInUseConnsPerHost&lt;/li&gt;
	&lt;li&gt;connPoolMaxShardedInUseConnsPerHost&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;These options set a maximum number of in-use connections per host:timeout pair, for their respective pools.  Previously, there was only a limit on the number of connections that would be stored in the pool.  This new parameter controls the number that are allowed to be in existence at any point in time, including ones in-use and checked-out by callers as well as stored in the pool.  These both default to infinity (no limit) to preserve the old behavior.&lt;/p&gt;

&lt;p&gt;If a caller tries to make a new connection and there are already *MaxInUse connections checked out, the calling thread will block until a connection is released back into the pool.  If the caller tried to make a connection with a socket timeout, then instead of blocking indefinitely, we will time out and fail to connect after that amount of time.&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;globalConnPoolIdleTimeoutMinutes&lt;/li&gt;
	&lt;li&gt;shardedConnPoolIdleTimeoutMinutes&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;These flags control the aging-out of old connections in their respective pools.  Previously, connections were kept around forever once created.  This led to problems where a momentary spike in cluster traffic would lead to a large number of persistent connections that would stick around after the spike, tying up resources.  These new parameters set an age limit, in minutes, on connections, and once connections sit idle in a pool for this amount of time, they will be closed.  These both default to infinity (no timeout) to preserve the old behavior.&lt;/p&gt;</comment>
                            <comment id="1757273" author="xgen-internal-githook" created="Wed, 20 Dec 2017 21:35:12 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;samantharitter&apos;, &apos;email&apos;: &apos;samantha.ritter@10gen.com&apos;, &apos;username&apos;: &apos;samantharitter&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28822&quot; title=&quot;Improve DBConnectionPool&amp;#39;s growth semantics&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-28822&quot;&gt;&lt;del&gt;SERVER-28822&lt;/del&gt;&lt;/a&gt; Add new dbclient connection pool options&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/9e7df79d3907a743e29b7333de6ea08a01f33a05&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/9e7df79d3907a743e29b7333de6ea08a01f33a05&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1668280" author="esha.maharishi@10gen.com" created="Fri, 8 Sep 2017 18:16:26 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=andrew.young&quot; class=&quot;user-hover&quot; rel=&quot;andrew.young&quot;&gt;andrew.young&lt;/a&gt; based on Jason&apos;s comment, I&apos;ll let the platforms team post the final update &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="1668223" author="jason.carey" created="Fri, 8 Sep 2017 17:37:13 +0000"  >&lt;p&gt;Just a note: we&apos;ll try to come back through and list what actually got ported for 3.6 (to the task executor) and what didn&apos;t as part of wrapping up this ticket.&lt;/p&gt;

&lt;p&gt;For now, note that the above list is a snapshot from april&lt;/p&gt;</comment>
                            <comment id="1668199" author="andrew.young" created="Fri, 8 Sep 2017 17:23:11 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=esha.maharishi&quot; class=&quot;user-hover&quot; rel=&quot;esha.maharishi&quot;&gt;esha.maharishi&lt;/a&gt;, would it be possible to get an updated version of your last comment that shows what changes made it into the release and what places are still using DBClient?&lt;/p&gt;</comment>
                            <comment id="1552694" author="esha.maharishi@10gen.com" created="Wed, 19 Apr 2017 16:04:50 +0000"  >&lt;p&gt;Here you go! This summarizes uses of DBClient that actually go over the network (i.e., does not include DBDirectClient).&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Notable paths in mongos/sharding already using TaskExecutor in 3.4&lt;/b&gt;:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;the find path (ClusterFind)&lt;/li&gt;
	&lt;li&gt;some sharding metadata commands (like addShard, addRangeToZone, balancerStop)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;b&gt;Notable paths in mongos/sharding that will switch from using DBClient to TaskExecutor in 3.6&lt;/b&gt;:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;the write path (ClusterWrite) - done as of 3.5.3&lt;/li&gt;
	&lt;li&gt;broadcast commands (like createIndexes, currentOp, count, distinct, listCollections) - everything that used to extend RunOnAllShardsCommand done as of 3.5.6; ones that used Strategy::commandOp in progress&lt;/li&gt;
	&lt;li&gt;explain commands - in progress&lt;/li&gt;
	&lt;li&gt;the aggregation path (ClusterAggregate) - scheduled for April 2017&lt;/li&gt;
	&lt;li&gt;mapReduce (MRCmd::run and MapReduceFinishCommand::run) - scheduled for May 2017&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;b&gt;Paths that will continue to use DBClient in 3.6&lt;/b&gt;:&lt;/p&gt;

&lt;p&gt;The motivation was to switch the paths that require shard versioning, to simplify the logic required for Safe Secondary Reads (PM-256). All shard versioning over DBClient was done through ShardConnection. Therefore, uses of DBClient outside ShardConnection will remain.&lt;/p&gt;

&lt;p&gt;1) uses of ScopedDbConnection, which can use DBClientConnection or DBClientReplicaSet, depending on the ConnectionString&lt;/p&gt;

&lt;p&gt;in mongos&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;ClusterAggregate::killAllCursors&lt;/li&gt;
	&lt;li&gt;ClusterKillOpCommand::run&lt;/li&gt;
	&lt;li&gt;CollectionStats::run&lt;/li&gt;
	&lt;li&gt;CmdListCollections, CmdListIndexes (via cursorCommandPassthrough)&lt;/li&gt;
	&lt;li&gt;DataSizeCmd::run&lt;/li&gt;
	&lt;li&gt;autosplit logic in FindAndModifyCmd, MRCmd, and ClusterWriter::write&lt;/li&gt;
	&lt;li&gt;MoveDatabasePrimaryCommand::run&lt;/li&gt;
	&lt;li&gt;ShardCollectionCmd::run&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;in mongod&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;DocumentSourceMergeCursors::CursorAndConnection&lt;/li&gt;
	&lt;li&gt;MigrationDestinationManager::_migrateDriver&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;in both&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;ReplicaSetMonitor&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;2) direct uses of DBClientConnection (mostly in replication)&lt;/p&gt;

&lt;p&gt;in mongod&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;CmdCloneCollection::run&lt;/li&gt;
	&lt;li&gt;isSelf&lt;/li&gt;
	&lt;li&gt;OplogReader::connect&lt;/li&gt;
	&lt;li&gt;RollbackSourceImpl::copyCollectionFromRemote&lt;/li&gt;
	&lt;li&gt;ConnectionPool::acquireConnection&lt;/li&gt;
	&lt;li&gt;replHandshake&lt;/li&gt;
	&lt;li&gt;appendReplicationInfo&lt;/li&gt;
	&lt;li&gt;CmdCopyDb::run&lt;/li&gt;
	&lt;li&gt;Cloner::copyDb&lt;/li&gt;
	&lt;li&gt;CmdCopyDbGetNonce::run&lt;/li&gt;
	&lt;li&gt;CmdCopyDbSaslStart::run&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;3) Finally, note that DBClient is also used in mongobridge, benchrun, and the shell.&lt;/p&gt;</comment>
                            <comment id="1552475" author="esha.maharishi@10gen.com" created="Wed, 19 Apr 2017 13:42:17 +0000"  >&lt;p&gt;Sorry, I got a bit sick and went home early yesterday, but I&apos;m working on this now.&lt;/p&gt;</comment>
                            <comment id="1550694" author="esha.maharishi@10gen.com" created="Mon, 17 Apr 2017 17:50:08 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=acm&quot; class=&quot;user-hover&quot; rel=&quot;acm&quot;&gt;acm&lt;/a&gt;, I can provide an enumerated list. Can I get it to you by EOD tomorrow?&lt;/p&gt;</comment>
                            <comment id="1550689" author="acm" created="Mon, 17 Apr 2017 17:42:41 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=renctan&quot; class=&quot;user-hover&quot; rel=&quot;renctan&quot;&gt;renctan&lt;/a&gt; - Can we get an enumeration of what those exceptions will be?&lt;/p&gt;</comment>
                            <comment id="1550675" author="renctan" created="Mon, 17 Apr 2017 17:37:10 +0000"  >&lt;p&gt;FYI: in mongos, we always return connections back to the pool after processing a request. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=esha.maharishi&quot; class=&quot;user-hover&quot; rel=&quot;esha.maharishi&quot;&gt;esha.maharishi&lt;/a&gt; is also currently working to convert most of the uses of ParallelSortClusteredCursor in mongos to AsyncResultsMerger. After the work is complete, almost all of the outgoing connections (with very few exceptions) from mongos will be coming from the asio connection pools.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                                                <inwardlinks description="is documented by">
                                        <issuelink>
            <issuekey id="492318">DOCS-11281</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="473600">SERVER-32380</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>22.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="15141"><![CDATA[v3.6]]></customfieldvalue>
    <customfieldvalue key="14340"><![CDATA[v3.4]]></customfieldvalue>
    <customfieldvalue key="13440"><![CDATA[v3.2]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[500A000000Y3PI2IAN, 500A000000a8O3DIAU]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 17 Apr 2017 17:37:10 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        6 years, 5 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_14262" key="com.atlassian.jira.plugin.system.customfieldtypes:datepicker">
                        <customfieldname>End date</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 2 Jan 2018 23:59:59 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-862</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>andrew.morrow@mongodb.com</customfieldvalue>
            <customfieldvalue>andrew.young</customfieldvalue>
            <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>esha.maharishi@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
            <customfieldvalue>mira.carey@mongodb.com</customfieldvalue>
            <customfieldvalue>randolph@mongodb.com</customfieldvalue>
            <customfieldvalue>samantha.ritter@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|ht5won:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htgjnz:</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>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="1877">Platforms 2017-09-11</customfieldvalue>
    <customfieldvalue id="1900">Platforms 2017-10-02</customfieldvalue>
    <customfieldvalue id="1983">Platforms 2017-12-04</customfieldvalue>
    <customfieldvalue id="2030">Platforms 2017-12-18</customfieldvalue>
    <customfieldvalue id="2050">Platforms 2018-01-01</customfieldvalue>
    <customfieldvalue id="2092">Platforms 2018-01-15</customfieldvalue>
    <customfieldvalue id="2129">Platforms 2018-02-12</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_14261" key="com.atlassian.jira.plugin.system.customfieldtypes:datepicker">
                        <customfieldname>Start date</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 17 Apr 2017 00:00:00 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hs4asv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>