<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:49:49 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-60444] ThreadPool::waitForIdle&apos;s header comment should note that it can&apos;t be called concurrently with shutdown</title>
                <link>https://jira.mongodb.org/browse/SERVER-60444</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;del&gt;In &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-53477&quot; title=&quot;ThreadPool::waitForIdle should be interruptible on thread pool shutdown()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-53477&quot;&gt;&lt;del&gt;SERVER-53477&lt;/del&gt;&lt;/a&gt;, we made the behavior of ThreadPool::waitForIdle match its documentation by making it safe to call before shutdown. To do so, we have waitForIdle return when the ThreadPool is shutting down, but with the caveat that there is no guarantee that work does or does not remain pending on the ThreadPool when waitForIdle returns due to shutdown.&lt;/del&gt;&#160;&lt;/p&gt;

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

&lt;p&gt;&lt;del&gt;When implementing that ticket, I expected that the idle-indicating condition variable would necessarily be notified by the ordinary mechanism&#160;&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/c57a1f545ad0b5c16fd98f24fda9fe920e1bea39/src/mongo/util/concurrency/thread_pool.cpp#L536&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;&#160;during shutdown as all worker threads drain tasks from the pending work queue before stopping work &lt;a href=&quot;https://github.com/mongodb/mongo/blob/c57a1f545ad0b5c16fd98f24fda9fe920e1bea39/src/mongo/util/concurrency/thread_pool.cpp#L481-L485&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;. However, because worker threads do not count themselves as idle when stopping due to shutdown, and therefore decrement ThreadPool::&lt;em&gt;numIdleThreads before stopping, that condition may never obtain. The thread that first sees pendingTasks as empty after&#160;completing its task and re-aquiring the lock in ThreadPool::doOneTask can check this condition&#160;_after&lt;/em&gt; other worker threads have stopped and therefore decremented ThreadPool::_numIdleThreads, and therefore will not see _threads.size() == _numIdleThreads. More importantly,&lt;/del&gt;&#160;&lt;/p&gt;

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

&lt;p&gt;&lt;del&gt;We need to notify &lt;em&gt;poolIsIdle separately when the ThreadPool enters state joinRequired to ensure that people who called waitForIdle&#160;_before&lt;/em&gt; shutdown are woken up on shutdown, regardless of the current status of the pending work queue or the threads that may be helping to drain it.&lt;/del&gt;&#160;&lt;/p&gt;

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

&lt;p&gt;update: after discussing with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=lingzhi.deng&quot; class=&quot;user-hover&quot; rel=&quot;lingzhi.deng&quot;&gt;lingzhi.deng&lt;/a&gt;&#160;and &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=schwerin&quot; class=&quot;user-hover&quot; rel=&quot;schwerin&quot;&gt;schwerin&lt;/a&gt;&#160; we realized providing waitForIdle with a safe-shutdown contract would have required more work and changes to the ThreadPool internals that were somewhat high-risk and unnecessary given the very few callers of waitForIdle. We&apos;ve decided instead that the new caller of waitForIdle in the TenantOplogApplier should obey the same shutdown-pattern as the existing caller OplogApplier (see &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60782&quot; title=&quot;ThreadPool::waitForIdle should not be called concurrently with shutdown in TenantOplogApplier shutdown&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60782&quot;&gt;&lt;del&gt;SERVER-60782&lt;/del&gt;&lt;/a&gt;). We&apos;ll now use this ticket to change the header comment for waitForIdle to indicate the safe usage of it requires that it is not called concurrently with shut-down or on an already shut-down pool&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1889414">SERVER-60444</key>
            <summary>ThreadPool::waitForIdle&apos;s header comment should note that it can&apos;t be called concurrently with shutdown</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="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</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>
                            <label>sa-remove-fv-backlog-22</label>
                    </labels>
                <created>Mon, 4 Oct 2021 18:26:58 +0000</created>
                <updated>Tue, 6 Dec 2022 00:53:36 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="4129754" author="george.wangensteen" created="Mon, 18 Oct 2021 15:45:47 +0000"  >&lt;p&gt;We should also revert the small change in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-53477&quot; title=&quot;ThreadPool::waitForIdle should be interruptible on thread pool shutdown()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-53477&quot;&gt;&lt;del&gt;SERVER-53477&lt;/del&gt;&lt;/a&gt; as part of this.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1901024">SERVER-60782</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>1.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_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>
                                        2 years, 16 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_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>
                            2 years, 16 weeks, 2 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>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|i046y7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr4brr:</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="5296">Service Arch 2021-10-18</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </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|i03t3j:</customfieldvalue>

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