<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:39:11 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-35217] killSessions command attempts to kill a transaction while holding SessionCatalog::_mutex, which leads to deadlock</title>
                <link>https://jira.mongodb.org/browse/SERVER-35217</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Attempting to acquire a LockManager lock while holding a mutex is prone to deadlock. &lt;a href=&quot;https://github.com/mongodb/mongo/blob/r4.0.0-rc0/src/mongo/db/session_catalog.cpp#L199-L208&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;The &lt;tt&gt;SessionCatalog::scanSessions()&lt;/tt&gt; function locks the session catalog and executes an arbitrary function on any matching sessions&lt;/a&gt;. For the &quot;killSessions&quot; command, this means that while holding the &lt;tt&gt;SessionCatalog::_mutex&lt;/tt&gt;, &lt;a href=&quot;https://github.com/mongodb/mongo/blob/r4.0.0-rc0/src/mongo/db/session.cpp#L851&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;it calls &lt;tt&gt;CursorManager::killAllCursorsForTransaction()&lt;/tt&gt;&lt;/a&gt;, which for a find cursor attempts to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/r4.0.0-rc0/src/mongo/db/cursor_manager.cpp#L518&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;acquire the collection lock in &lt;tt&gt;CursorManager::withCursorManager()&lt;/tt&gt;&lt;/a&gt;. Since &lt;a href=&quot;https://github.com/mongodb/mongo/blob/r4.0.0-rc0/src/mongo/db/kill_sessions_local.cpp#L82&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the &lt;tt&gt;killAllExpiredTransactions()&lt;/tt&gt; function also calls &lt;tt&gt;SessionCatalog::scanSessions()&lt;/tt&gt;&lt;/a&gt;, it isn&apos;t possible to reap expired transactions while the &quot;killSessions&quot; command is running. It similarly isn&apos;t possible to commit or abort a transaction while the &quot;killSessions&quot; command is running because &lt;a href=&quot;https://github.com/mongodb/mongo/blob/r4.0.0-rc0/src/mongo/db/session_catalog.cpp#L128&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;SessionCatalog::checkOutSession()&lt;/tt&gt; must acquire the &lt;tt&gt;SessionCatalog::_mutex&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="549592">SERVER-35217</key>
            <summary>killSessions command attempts to kill a transaction while holding SessionCatalog::_mutex, which leads to deadlock</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</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="tess.avitabile@mongodb.com">Tess Avitabile</assignee>
                                    <reporter username="max.hirschhorn@mongodb.com">Max Hirschhorn</reporter>
                        <labels>
                            <label>bkp</label>
                            <label>disabled-test</label>
                            <label>todo_in_code</label>
                    </labels>
                <created>Fri, 25 May 2018 03:16:30 +0000</created>
                <updated>Sun, 29 Oct 2023 22:31:25 +0000</updated>
                            <resolved>Fri, 8 Jun 2018 17:56:53 +0000</resolved>
                                    <version>4.0.0-rc0</version>
                                    <fixVersion>4.0.0-rc5</fixVersion>
                    <fixVersion>4.1.1</fixVersion>
                                    <component>Concurrency</component>
                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="1915455" author="xgen-internal-githook" created="Fri, 8 Jun 2018 17:56:33 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;tessavitabile&apos;, &apos;name&apos;: &apos;Tess Avitabile&apos;, &apos;email&apos;: &apos;tess.avitabile@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35217&quot; title=&quot;killSessions command attempts to kill a transaction while holding SessionCatalog::_mutex, which leads to deadlock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35217&quot;&gt;&lt;del&gt;SERVER-35217&lt;/del&gt;&lt;/a&gt; Do not kill associated client cursors when transaction ends&lt;/p&gt;

&lt;p&gt;(cherry picked from commit c0273c0a89e73ecfd7848fd4906a8e3c2d5886b9)&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/ad984b21834dfd2c46ad1d32882d6461f20e9d08&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/ad984b21834dfd2c46ad1d32882d6461f20e9d08&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1915454" author="xgen-internal-githook" created="Fri, 8 Jun 2018 17:55:46 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;tessavitabile&apos;, &apos;name&apos;: &apos;Tess Avitabile&apos;, &apos;email&apos;: &apos;tess.avitabile@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35217&quot; title=&quot;killSessions command attempts to kill a transaction while holding SessionCatalog::_mutex, which leads to deadlock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35217&quot;&gt;&lt;del&gt;SERVER-35217&lt;/del&gt;&lt;/a&gt; Do not kill associated client cursors when transaction ends&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c0273c0a89e73ecfd7848fd4906a8e3c2d5886b9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c0273c0a89e73ecfd7848fd4906a8e3c2d5886b9&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1912617" author="tess.avitabile" created="Wed, 6 Jun 2018 16:55:32 +0000"  >&lt;p&gt;To address this issue, we will no longer kill associated client cursors when a transaction aborts or commits. That is, we will revert the work done in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-33690&quot; title=&quot;Transaction abort and commit should kill any associated client cursors&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-33690&quot;&gt;&lt;del&gt;SERVER-33690&lt;/del&gt;&lt;/a&gt; to kill client cursors. There is no need to kill client cursors when a transaction aborts or commits because drivers issue a &lt;tt&gt;killCursors&lt;/tt&gt; command when a cursor is closed or goes out of scope. Drivers perform this cleanup regardless of whether the cursor was opened as part of a transaction. The &lt;tt&gt;killCursors&lt;/tt&gt; command does not need to sent with the same &lt;tt&gt;lsid&lt;/tt&gt; or &lt;tt&gt;txnNumber&lt;/tt&gt; as the command that created the cursor. If &lt;tt&gt;killCursors&lt;/tt&gt; is not sent, we rely on our usual fallbacks of cursor timeout and session expiration to clean up the client cursor. There is no risk of using a cursor after the transaction ends, since cursors may only be iterated in the transaction in which they were created (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-33367&quot; title=&quot;Enforce a cursor is iterated in a transaction/session iff it was created in that transaction/session&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-33367&quot;&gt;&lt;del&gt;SERVER-33367&lt;/del&gt;&lt;/a&gt;). &lt;/p&gt;

&lt;p&gt;The decision was made with &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=shane.harvey&quot; class=&quot;user-hover&quot; rel=&quot;shane.harvey&quot;&gt;shane.harvey&lt;/a&gt;, and &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jesse&quot; class=&quot;user-hover&quot; rel=&quot;jesse&quot;&gt;jesse&lt;/a&gt;.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="563563">SERVER-35770</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="881098">SERVER-42550</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="537583">SERVER-34781</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="535394">SERVER-34732</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="538035">SERVER-34795</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="537577">SERVER-34779</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="15640"><![CDATA[v4.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>Wed, 6 Jun 2018 16:55:32 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 35 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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 years, 35 weeks, 5 days ago
                        </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>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>max.hirschhorn@mongodb.com</customfieldvalue>
            <customfieldvalue>tess.avitabile@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htz0zj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htpq7b:</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="2297">Repl 2018-06-18</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|htyn8v:</customfieldvalue>

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