<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:57:57 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-1762] deadlock between db mutex and js mutex</title>
                <link>https://jira.mongodb.org/browse/SERVER-1762</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;There is a reachable deadlock condition between the db mutex and js mutex, which has been seen in v8 (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1756&quot; title=&quot;hang during parallel tests&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1756&quot;&gt;&lt;del&gt;SERVER-1756&lt;/del&gt;&lt;/a&gt;).  The same issue may affect spidermonkey, as a spidermonkey mutex guards all sm calls.&lt;/p&gt;

&lt;p&gt;To fix, all javascript calls from c++ must occur while a db mutex is held.  In the diagnosed case, javascript calls within MRState::MRState() were made without a db mutex.  These calls held the v8 mutex and requested the db mutex, while a concurrent db.eval held the db mutex and requested the v8 mutex.&lt;/p&gt;</description>
                <environment></environment>
        <key id="13050">SERVER-1762</key>
            <summary>deadlock between db mutex and js mutex</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="eliot">Eliot Horowitz</assignee>
                                    <reporter username="aaron">Aaron Staple</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 Sep 2010 05:07:15 +0000</created>
                <updated>Mon, 29 Aug 2011 15:56:41 +0000</updated>
                            <resolved>Thu, 17 Mar 2011 16:58:05 +0000</resolved>
                                                                    <component>JavaScript</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="26112" author="eliot" created="Thu, 17 Mar 2011 16:58:05 +0000"  >&lt;p&gt;Switching to v8&lt;/p&gt;</comment>
                            <comment id="21990" author="eliot" created="Mon, 3 Jan 2011 15:46:53 +0000"  >&lt;p&gt;If we switch to v8 may not have to worry.&lt;/p&gt;</comment>
                            <comment id="18131" author="auto" created="Mon, 13 Sep 2010 21:58:26 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;astaple&apos;, &apos;name&apos;: &apos;Aaron&apos;, &apos;email&apos;: &apos;aaron@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1762&quot; title=&quot;deadlock between db mutex and js mutex&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1762&quot;&gt;&lt;del&gt;SERVER-1762&lt;/del&gt;&lt;/a&gt; clean up v8 mutex usage somewhat&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/e47687bd03132c4c526ff61754eb8634fd9661a1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/e47687bd03132c4c526ff61754eb8634fd9661a1&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="17928" author="aaron" created="Thu, 9 Sep 2010 06:42:47 +0000"  >&lt;p&gt;Yeah we can fix it that way too, and I should have thought of and mentioned that.  I was just thinking that it might be easier to ensure correct behavior by getting a db mutex before doing anything with js than it would be to check the various callbacks in the js implementations to see if they need a db lock.  But obviously if anything time consuming is going to happen in js it would be best to do it without the db lock when that&apos;s possible.&lt;/p&gt;

&lt;p&gt;Right now the v8 implementation does unlock for the major db operations (this is what allows concurrent threads in the shell).  It looks like it was not unlocking for loadStored(), which puts variables inside the system.js namespace, and I think this is what was triggering &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1756&quot; title=&quot;hang during parallel tests&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1756&quot;&gt;&lt;del&gt;SERVER-1756&lt;/del&gt;&lt;/a&gt;.  I&apos;ll see if I can find any other callbacks that can grab a db lock and handle those too.&lt;/p&gt;</comment>
                            <comment id="17927" author="auto" created="Thu, 9 Sep 2010 06:31:28 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;astaple&apos;, &apos;name&apos;: &apos;Aaron&apos;, &apos;email&apos;: &apos;aaron@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1762&quot; title=&quot;deadlock between db mutex and js mutex&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1762&quot;&gt;&lt;del&gt;SERVER-1762&lt;/del&gt;&lt;/a&gt; don&apos;t call loadStored() with v8 mutex&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/9221b81acb863672eef708d052ad68c9d7aa83f0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/9221b81acb863672eef708d052ad68c9d7aa83f0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="17924" author="eliot" created="Thu, 9 Sep 2010 05:13:16 +0000"  >&lt;p&gt;This is definitely true for spidermonkey.&lt;/p&gt;

&lt;p&gt;For v8 - can&apos;t we handle inside v8?&lt;br/&gt;
I though we unlocked when we left v8 and went back into the db?&lt;br/&gt;
Since v8 is &quot;thread safe&quot; should be able to not require a db lock, right?&lt;/p&gt;

&lt;p&gt;If so - can you fix v8 and then re-assign to me?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="13042">SERVER-1756</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>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 9 Sep 2010 05:13:16 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 48 weeks, 6 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>ian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 48 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></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>aaron</customfieldvalue>
            <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpfjj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrij7b:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>21763</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|hsw97r:</customfieldvalue>

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