<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:04:26 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-66084] set_step_params.js can induce deadlock by preventing targeter from discovering shard</title>
                <link>https://jira.mongodb.org/browse/SERVER-66084</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The test set_step_param.js (&lt;a href=&quot;https://github.com/mongodb/mongo/blob/e3f9dca6ad9888fd696c99f1b1ae2a4c7fdd932b/jstests/noPassthrough/set_step_params.js#L1)&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/e3f9dca6ad9888fd696c99f1b1ae2a4c7fdd932b/jstests/noPassthrough/set_step_params.js#L1)&lt;/a&gt; ; attempts to test the ability to cap the number of connections the connection pools can have in the currently-establishing state via the &apos;maxConnecting&apos; sharding-task-executor parameter. It works as follows:&#160;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;set the maxConnecting parameter to two on mongos&lt;/li&gt;
	&lt;li&gt;set the &apos;waitInHello&apos; failpoint on the shard. this blocks the shard from responding to hellos&lt;/li&gt;
	&lt;li&gt;drop all connections from mongos to the shard&lt;/li&gt;
	&lt;li&gt;send two find()&apos;s to the mongos that would target the shard. to service these finds(), mongos attempts to grab two connections to the shard. Because the connections were just dropped, the connectionPool attempts to establish two new connections to the shard. But because the waitInHello failpoint is set, those connections get stuck in the &apos;establishing&apos; state&lt;/li&gt;
	&lt;li&gt;the test then asserts that two connections are in the &apos;refreshing&apos;/&apos;establishing&apos; state&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;However, the following bad interleaving is possible, causing a deadlock for the operations:&#160;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;After the waitInHello failpoint is set on the shards, concurrently with the dropConnections call on mongos, mongos&apos; ReplicaSetMonitor&apos;s hello_monitor is scheduling a hello on the shard to monitor the&#160; shard. The scheduling fails with error PooledConnectionsDropped, because the request for a connection from the connection pool is failed as the dropConnections is being processed.&#160;&lt;/li&gt;
	&lt;li&gt;The RSM then marks the host as failed and attempts to schedule another &apos;hello&apos; to refresh monitoring of it&lt;/li&gt;
	&lt;li&gt;The RSM&apos;s hello is scheduled and sent but blocks on the shard-side due to the waitInHello failpoint&lt;/li&gt;
	&lt;li&gt;set_step_params.js sends the finds() intended to open connections. However, before these finds attempt to acquire connections from the connection pool, they first need to perform &apos;targeting&apos; - resolving the shard to host and ports&lt;/li&gt;
	&lt;li&gt;the targeting relies on the RSM to have information about the shard, but the RSM&apos;s monitoring is blocked by the failpoing&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;In short, the test is stuck waiting for the RSM to update monitoring of the shard, but the RSM is blocked waiting for the test to release the waitInHello failpoint.&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;To fix this we should probably have the test hang connection establishment from the&#160; mongos connection-pool under-test on the mongos side, rather than using the waitInHello failpoint to hand connection establishment on the shard-side. This will allow other necessary connections to the shard, like this RSM monitoring, to go through.&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2036439">SERVER-66084</key>
            <summary>set_step_params.js can induce deadlock by preventing targeter from discovering shard</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="1" iconUrl="https://jira.mongodb.org/images/icons/statuses/open.png" description="">Open</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-server-servicearch">Backlog - Service Architecture</assignee>
                                    <reporter username="george.wangensteen@mongodb.com">George Wangensteen</reporter>
                        <labels>
                    </labels>
                <created>Fri, 29 Apr 2022 15:43:20 +0000</created>
                <updated>Tue, 6 Dec 2022 00:10:41 +0000</updated>
                                                                                                <votes>1</votes>
                                    <watches>1</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25132"><![CDATA[Service Arch]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 40 weeks, 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_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>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 year, 40 weeks, 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_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>backlog-server-servicearch</customfieldvalue>
            <customfieldvalue>george.wangensteen@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0t4o7:</customfieldvalue>

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

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