<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:33:22 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-76700] Increase window of acceptable elapsed CPU times in OperationCPUTimerTest::TestReset</title>
                <link>https://jira.mongodb.org/browse/SERVER-76700</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;OperationCPUTimerTest::TestReset has a step where it starts a timer, busy waits for 1ms, and then checks to see if the timer observed 1ms of elapsed CPU time. This has proven to be a flaky assertion, with the elapsed time sometimes being less than 1ms. Most failures see an elapsed CPU time in the 800,000ns range, but some go as low as 150,000ns.&lt;/p&gt;

&lt;p&gt;My understanding of why this might happen is the following:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;The &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/operation_cpu_timer_test.cpp#L68-L78&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;busy waiting&lt;/a&gt; is implemented by creating an atomic boolean and continually reading it in a loop, while having a separate thread use std::current_thread::sleep_for to sleep for 1ms before setting the atomic.&lt;/li&gt;
	&lt;li&gt;Under the hood, sleep_for uses &lt;a href=&quot;https://man7.org/linux/man-pages/man2/nanosleep.2.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;nanosleep&lt;/a&gt;, which is documented as using Linux&apos;s &lt;a href=&quot;https://man7.org/linux/man-pages/man2/clock_gettime.2.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;CLOCK_MONOTONIC&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;The timer being tested calculates elapsed time by subtracting the two measurements taken during start() and stop(). Both of these measurements are made using Linux&apos;s &lt;a href=&quot;https://man7.org/linux/man-pages/man2/clock_gettime.2.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;CLOCK_THREAD_CPUTIME&lt;/a&gt;, which is based on the number of CPU cycles observed.&lt;/li&gt;
	&lt;li&gt;Differences in the ways these two clocks operate might lead to inconsistencies in the amount of time spent sleeping and the amount of time perceived as being used by the CPU.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;In particular, I have a few ideas about what these differences might be:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;MONOTONIC_CLOCK always moves forward and isn&apos;t subject to regular changes of the system clock, but it can be adjusted by ntpd. If ntpd were slewing the clock forward, it could make the thread wake up sooner than expected, causing the observation of CPU time to stop earlier than planned.&lt;/li&gt;
	&lt;li&gt;The virtualization used for the Evergreen hosts could affect the measurement of a thread&apos;s CPU time. While the test thread is &quot;busy waiting&quot;, the hypervisor could steal some CPU time away for other hosts running on the same hardware, decreasing the number of cycles that CLOCK_THREAD_CPUTIME observes as being performed by the thread. Meanwhile, the thread using CLOCK_MONOTONIC still sleeps for the normal 1ms. When checking how much CPU time was used, the timer will then under-report elapsed time due to the number of cycles being less than was expected given its idea of the virtual CPU frequency.
	&lt;ul&gt;
		&lt;li&gt;See here for an overview of some of the issues with time keeping and virtualization: &lt;a href=&quot;https://www.kernel.org/doc/Documentation/virtual/kvm/timekeeping.txt&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://www.kernel.org/doc/Documentation/virtual/kvm/timekeeping.txt&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I can&apos;t reproduce this test failure, so I can&apos;t be sure that this diagnosis is correct, but the implementation of PosixTimer and the test are simple enough that it seems unlikely that these failures are due to a bug in the server. In light of that, a solution to this would be to make the test accept a wider range of observed CPU time, including time less than the 1ms that was meant to be busy-waited.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2328054">SERVER-76700</key>
            <summary>Increase window of acceptable elapsed CPU times in OperationCPUTimerTest::TestReset</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="13201">Fixed</resolution>
                                        <assignee username="patrick.freed@mongodb.com">Patrick Freed</assignee>
                                    <reporter username="patrick.freed@mongodb.com">Patrick Freed</reporter>
                        <labels>
                    </labels>
                <created>Fri, 28 Apr 2023 22:32:23 +0000</created>
                <updated>Mon, 20 Nov 2023 14:53:33 +0000</updated>
                            <resolved>Mon, 1 May 2023 17:09:39 +0000</resolved>
                                                    <fixVersion>7.1.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="5522427" author="xgen-internal-githook" created="Fri, 23 Jun 2023 21:18:26 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Patrick Freed&apos;, &apos;email&apos;: &apos;patrick.freed@mongodb.com&apos;, &apos;username&apos;: &apos;patrickfreed&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-76700&quot; title=&quot;Increase window of acceptable elapsed CPU times in OperationCPUTimerTest::TestReset&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-76700&quot;&gt;&lt;del&gt;SERVER-76700&lt;/del&gt;&lt;/a&gt; Further relax assertion of minimum observed CPU time in TestReset&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c71e4899c7b3ac25178b2065072c911105c000c1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c71e4899c7b3ac25178b2065072c911105c000c1&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5391155" author="xgen-internal-githook" created="Mon, 1 May 2023 15:42:28 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Patrick Freed&apos;, &apos;email&apos;: &apos;patrick.freed@mongodb.com&apos;, &apos;username&apos;: &apos;patrickfreed&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-76700&quot; title=&quot;Increase window of acceptable elapsed CPU times in OperationCPUTimerTest::TestReset&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-76700&quot;&gt;&lt;del&gt;SERVER-76700&lt;/del&gt;&lt;/a&gt; Increase window of acceptable elapsed CPU times in OperationCPUTimerTest::TestReset&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/75a44f1951a367634314e053298eb5acacdd799d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/75a44f1951a367634314e053298eb5acacdd799d&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2088506">SERVER-67990</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2147879">SERVER-70091</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25578"><![CDATA[v7.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>Fri, 28 Apr 2023 22:51:26 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        32 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_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </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>backlog-server-backport</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            32 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>22.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>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>patrick.freed@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i27047:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1papc:</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_22250" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Special Downgrade Instructions Required</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="23343"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="7348">Service Arch 2023-05-01</customfieldvalue>
    <customfieldvalue id="7349">Service Arch 2023-05-15</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|i26m9j:</customfieldvalue>

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