<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:59:23 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-2244] Locks, mutual exclusion, blocking/waiting</title>
                <link>https://jira.mongodb.org/browse/SERVER-2244</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Summary:&lt;/p&gt;

&lt;p&gt;I would find the availability of networked connection-owned locks hugely beneficial ... that is mutual exclusion AND blocking/waiting. Mutual exclusion is possible, but locks can be orphaned ... blocking/waiting is only made possible via polling. This could be implemented as something as &quot;simple&quot; as &quot;db.aquireLock(X), db.releaseLock(X), etc&quot;.&lt;/p&gt;


&lt;p&gt;Long version:&lt;/p&gt;

&lt;p&gt;Mutual exclusion is very handy and can be used to improve/solve many issues somtimes faced when dealing with resources in more &quot;complex&quot; web services. Like generating images on-the-fly, while making sure only one process actually generates it, requires mutual exclusion... or for making sure that multiple user-requests cannot enter a race-condition and incorrectly use and modify the same session simultaenously (PHP uses file-locking for file based sessions). For the purpose of this &quot;jira issue&quot;, there are generally two important parts to mutual exclusion:&lt;/p&gt;

&lt;p&gt;1. Ensuring that only one &quot;consumer&quot; can access a &quot;resource&quot; at any time&lt;br/&gt;
2. Allowing a &quot;consumer&quot; to wait for a &quot;resource&quot; to become available&lt;/p&gt;

&lt;p&gt;For web-services and higher-level mutual exclusion, there are generally three primary uses, &quot;task queues&quot; (a lot of uses), &quot;exclusive resource access&quot; (like sessions) and &quot;exclusive resource generation&quot; (like thumbnail generation).&lt;/p&gt;

&lt;p&gt;#1 allows the implementation of all the above &quot;uses&quot;... but #2 is required for instant/fast notification of the completion of a task or the availability of a resource.&lt;/p&gt;

&lt;p&gt;MongoDB currently supports #1 by way of &quot;findAndModify&quot; and &quot;insert&quot;, because of the existance of safe and atomic updating of single documents. But does not support #2, it can be worked around by &quot;busy-waiting&quot; and continously polling the database at a (fast) fixed rate. This is certainly not ideal, both because it incurs additional overhead and also delays resource access because of the polling rate, which isn&apos;t desirable for fast tasks (as is often the case with interactive web services). Additionally, due to the lack of a native implementation, a lock would not be released if a fatal error occurs (when disconnected)... which is certainly important, but livable.&lt;/p&gt;

&lt;p&gt;MySQL provides both #1 and #2 as well as releasing any owned locks on disconnect (one can acquire mutexes and lock tables). It is perhaps debatable whether or not a database should be &quot;required&quot; to facilitate such functionality, but the reality of it is that it is tremendously useful for certain problems (especially in conjuction with the GridFS-system). It sure would tie up the knot for me personally, being able to put sessions in MongoDB and efficiently taking care of resource generation and task queues.&lt;/p&gt;

&lt;p&gt;The simplest solution being to just provide mutexes (read: db.aquireLock(X), db.releaseLock(X), etc) that are networked and connection-dependent. And there are certainly other ways of making it &quot;integrate&quot; more deeply with MongoDB, but that&apos;s something I don&apos;t really dare to speculate about.&lt;/p&gt;

&lt;p&gt;... or is this something that MongoDB doesn&apos;t want to be concerned with?&lt;/p&gt;</description>
                <environment></environment>
        <key id="13994">SERVER-2244</key>
            <summary>Locks, mutual exclusion, blocking/waiting</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="backlog-server-execution">Backlog - Storage Execution Team</assignee>
                                    <reporter username="syranide">Andreas Svensson</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 Dec 2010 14:15:15 +0000</created>
                <updated>Tue, 6 Dec 2022 05:46:32 +0000</updated>
                            <resolved>Tue, 18 Dec 2018 20:02:38 +0000</resolved>
                                                                    <component>Concurrency</component>
                                        <votes>3</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2094839" author="sara.williamson" created="Tue, 18 Dec 2018 20:02:38 +0000"  >&lt;p&gt;We are closing this, as you can implement your locking project using transactions.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25136"><![CDATA[Storage Execution]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000kExVbQAK]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 18 Dec 2018 20:02:38 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 8 weeks, 1 day 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>
                            5 years, 8 weeks, 1 day 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_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>syranide</customfieldvalue>
            <customfieldvalue>backlog-server-execution</customfieldvalue>
            <customfieldvalue>sara.williamson@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrp9xr:</customfieldvalue>

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

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

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