<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:38:29 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-56147] In connection PoolForHost, a thread blocked waiting for free connection may be never notified</title>
                <link>https://jira.mongodb.org/browse/SERVER-56147</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;waitForFreeConnection() is blocked for condition variable &lt;a href=&quot;https://github.com/mongodb/mongo/blob/9df1b3a80f39cf7e7ccd6264a207518426a524f6/src/mongo/client/connpool.cpp#L234&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;. To work properly, the _cv should be notified each time the `_checkedOut` is decremented.&lt;/p&gt;

&lt;p&gt;1. In one code path, in PoolForHost::done() `_checkedOut` is properly followed by notify, because the only call site is &lt;a href=&quot;https://github.com/mongodb/mongo/blob/9df1b3a80f39cf7e7ccd6264a207518426a524f6/src/mongo/client/connpool.cpp#L429-L436&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;DBConnectionPool::release()&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Even though this is correct, it is over-optimization. It is clearer to notify near the place where condition is changed. If this is regarded as an important optimization, a comment should be added.&lt;/p&gt;

&lt;p&gt;2. However in DBConnectionPool::decrementEgress() the `_checkedOut` is decremented and the _cv is not notified. The call site is &lt;a href=&quot;https://github.com/mongodb/mongo/blob/9df1b3a80f39cf7e7ccd6264a207518426a524f6/src/mongo/client/connpool.cpp#L652&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ScopedDbConnection::kill()&lt;/a&gt;. This must be fixed.&lt;/p&gt;

&lt;p&gt;When using ScopedDbConnection, its deletion will not trigger reusing the connection.&lt;/p&gt;


&lt;p&gt;A possible deadlock created by this bug may hit the ReplicaSetMonitor. In Refresher::_refreshUntilMatches() we are &lt;a href=&quot;https://github.com/mongodb/mongo/blob/9df1b3a80f39cf7e7ccd6264a207518426a524f6/src/mongo/client/replica_set_monitor.cpp#L862&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;using the ScopedDbConnection here&lt;/a&gt;. If ReplicaSetMonitor is releasing a scoped connection, this will not trigger anyone waiting for it. If that was the moment RSM detected a change, the deadlock may prevent other blocked threads to take advantage of freed connection.&lt;/p&gt;

&lt;p&gt;This problem may not be present in v4.2 and late4r because of significant refactoring like &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35688&quot; title=&quot;Futurize the RSM implementation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35688&quot;&gt;&lt;del&gt;SERVER-35688&lt;/del&gt;&lt;/a&gt; that were impossible to backport.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1681857">SERVER-56147</key>
            <summary>In connection PoolForHost, a thread blocked waiting for free connection may be never notified</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="andrew.shuvalov@mongodb.com">Andrew Shuvalov</assignee>
                                    <reporter username="andrew.shuvalov@mongodb.com">Andrew Shuvalov</reporter>
                        <labels>
                    </labels>
                <created>Fri, 16 Apr 2021 18:10:27 +0000</created>
                <updated>Sun, 29 Oct 2023 21:54:50 +0000</updated>
                            <resolved>Mon, 10 May 2021 19:47:28 +0000</resolved>
                                    <version>4.0.20</version>
                                    <fixVersion>4.0 Required</fixVersion>
                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3764800" author="xgen-internal-githook" created="Mon, 10 May 2021 19:44:36 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Andrew Shuvalov&apos;, &apos;email&apos;: &apos;andrew.shuvalov@mongodb.com&apos;, &apos;username&apos;: &apos;shuvalov-mdb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-56147&quot; title=&quot;In connection PoolForHost, a thread blocked waiting for free connection may be never notified&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-56147&quot;&gt;&lt;del&gt;SERVER-56147&lt;/del&gt;&lt;/a&gt;: In connection PoolForHost, a thread blocked waiting for free connection may be never notified&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/fa92dae8174f68fec1018d572f14e490e5467eac&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/fa92dae8174f68fec1018d572f14e490e5467eac&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3761535" author="xgen-internal-githook" created="Fri, 7 May 2021 18:01:01 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Andrew Shuvalov&apos;, &apos;email&apos;: &apos;andrew.shuvalov@mongodb.com&apos;, &apos;username&apos;: &apos;shuvalov-mdb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-56147&quot; title=&quot;In connection PoolForHost, a thread blocked waiting for free connection may be never notified&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-56147&quot;&gt;&lt;del&gt;SERVER-56147&lt;/del&gt;&lt;/a&gt;: revert connection pool notification fix with test crashing on Windows&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/23334d09cd768898b6524cfe6499d7d036f20d21&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/23334d09cd768898b6524cfe6499d7d036f20d21&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3739841" author="xgen-internal-githook" created="Mon, 26 Apr 2021 20:45:32 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Andrew Shuvalov&apos;, &apos;email&apos;: &apos;andrew.shuvalov@mongodb.com&apos;, &apos;username&apos;: &apos;shuvalov-mdb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-56217&quot; title=&quot;PoolForHost::_maxInUse is init to &amp;lt;int&amp;gt;::max and cannot be changed, and when connections are maxed DBConnectionPool::get() always throws&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-56217&quot;&gt;&lt;del&gt;SERVER-56217&lt;/del&gt;&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-56147&quot; title=&quot;In connection PoolForHost, a thread blocked waiting for free connection may be never notified&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-56147&quot;&gt;&lt;del&gt;SERVER-56147&lt;/del&gt;&lt;/a&gt;: maxed out connection pool should respect get() timeout and CV should be notified on connection release&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/3d8730be2c747dfe869614e215808ceddafa8516&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/3d8730be2c747dfe869614e215808ceddafa8516&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3739836" author="xgen-internal-githook" created="Mon, 26 Apr 2021 20:45:25 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Andrew Shuvalov&apos;, &apos;email&apos;: &apos;andrew.shuvalov@mongodb.com&apos;, &apos;username&apos;: &apos;shuvalov-mdb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-56217&quot; title=&quot;PoolForHost::_maxInUse is init to &amp;lt;int&amp;gt;::max and cannot be changed, and when connections are maxed DBConnectionPool::get() always throws&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-56217&quot;&gt;&lt;del&gt;SERVER-56217&lt;/del&gt;&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-56147&quot; title=&quot;In connection PoolForHost, a thread blocked waiting for free connection may be never notified&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-56147&quot;&gt;&lt;del&gt;SERVER-56147&lt;/del&gt;&lt;/a&gt;: maxed out connection pool should respect get() timeout and CV should be notified on connection release&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/1d5cbc113d4318b79831113790c3abd09ba25098&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/1d5cbc113d4318b79831113790c3abd09ba25098&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3739834" author="xgen-internal-githook" created="Mon, 26 Apr 2021 20:45:22 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Andrew Shuvalov&apos;, &apos;email&apos;: &apos;andrew.shuvalov@mongodb.com&apos;, &apos;username&apos;: &apos;shuvalov-mdb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-56217&quot; title=&quot;PoolForHost::_maxInUse is init to &amp;lt;int&amp;gt;::max and cannot be changed, and when connections are maxed DBConnectionPool::get() always throws&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-56217&quot;&gt;&lt;del&gt;SERVER-56217&lt;/del&gt;&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-56147&quot; title=&quot;In connection PoolForHost, a thread blocked waiting for free connection may be never notified&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-56147&quot;&gt;&lt;del&gt;SERVER-56147&lt;/del&gt;&lt;/a&gt;: maxed out connection pool should respect get() timeout and CV should be notified on connection release&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/5c8ec91022cd185490fb960a5a7fdaf1c58f94d7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5c8ec91022cd185490fb960a5a7fdaf1c58f94d7&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3736860" author="xgen-internal-githook" created="Fri, 23 Apr 2021 22:30:49 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Andrew Shuvalov&apos;, &apos;email&apos;: &apos;andrew.shuvalov@mongodb.com&apos;, &apos;username&apos;: &apos;shuvalov-mdb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-56147&quot; title=&quot;In connection PoolForHost, a thread blocked waiting for free connection may be never notified&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-56147&quot;&gt;&lt;del&gt;SERVER-56147&lt;/del&gt;&lt;/a&gt;: In connection PoolForHost, a thread blocked waiting for free connection may be never notified&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/7a93b8e33051ea6e0b65f7431b736f71091509f8&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/7a93b8e33051ea6e0b65f7431b736f71091509f8&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="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 23 Apr 2021 22:30:49 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 39 weeks, 2 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_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></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_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 39 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>184.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>andrew.shuvalov@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hz52qn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hyq26v:</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_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|hz4ozr:</customfieldvalue>

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