<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:49:43 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-38697] Powercycle kill by PID might try to kill the wrong process</title>
                <link>https://jira.mongodb.org/browse/SERVER-38697</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;It&apos;s possible that a PID for a process can be reused causing the wrong process to be killed by powercycle. This problem has been seen primarily on Windows.&lt;/p&gt;</description>
                <environment></environment>
        <key id="657433">SERVER-38697</key>
            <summary>Powercycle kill by PID might try to kill the wrong process</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="max.hirschhorn@mongodb.com">Max Hirschhorn</assignee>
                                    <reporter username="jonathan.abrahams">Jonathan Abrahams</reporter>
                        <labels>
                            <label>tig-powercycle</label>
                    </labels>
                <created>Tue, 18 Dec 2018 21:55:56 +0000</created>
                <updated>Sun, 29 Oct 2023 22:25:35 +0000</updated>
                            <resolved>Fri, 1 Mar 2019 19:33:59 +0000</resolved>
                                                    <fixVersion>3.6.12</fixVersion>
                    <fixVersion>4.0.7</fixVersion>
                    <fixVersion>4.1.9</fixVersion>
                                    <component>Testing Infrastructure</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2171482" author="xgen-internal-githook" created="Tue, 5 Mar 2019 18:47:39 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Max Hirschhorn&apos;, &apos;email&apos;: &apos;max.hirschhorn@mongodb.com&apos;, &apos;username&apos;: &apos;visemet&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-38697&quot; title=&quot;Powercycle kill by PID might try to kill the wrong process&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-38697&quot;&gt;&lt;del&gt;SERVER-38697&lt;/del&gt;&lt;/a&gt; Use process creation time to detect pid reuse.&lt;/p&gt;

&lt;p&gt;Changes start_cmd() to use psutil.Popen() rather than subprocess.Popen()&lt;br/&gt;
in order to cache the creation time of the child process.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit d43369c671a596ee816f44038fca3423a0a33126)&lt;br/&gt;
Branch: v3.6&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/006233d0e02d6c902ba2ebd468f0314212d01bf4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/006233d0e02d6c902ba2ebd468f0314212d01bf4&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2171479" author="xgen-internal-githook" created="Tue, 5 Mar 2019 18:46:40 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Max Hirschhorn&apos;, &apos;email&apos;: &apos;max.hirschhorn@mongodb.com&apos;, &apos;username&apos;: &apos;visemet&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-38697&quot; title=&quot;Powercycle kill by PID might try to kill the wrong process&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-38697&quot;&gt;&lt;del&gt;SERVER-38697&lt;/del&gt;&lt;/a&gt; Use process creation time to detect pid reuse.&lt;/p&gt;

&lt;p&gt;Changes start_cmd() to use psutil.Popen() rather than subprocess.Popen()&lt;br/&gt;
in order to cache the creation time of the child process.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit d43369c671a596ee816f44038fca3423a0a33126)&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/f80f05151377eed5119a8c9cb52667d50f668610&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/f80f05151377eed5119a8c9cb52667d50f668610&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2167805" author="xgen-internal-githook" created="Fri, 1 Mar 2019 19:33:52 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Max Hirschhorn&apos;, &apos;email&apos;: &apos;max.hirschhorn@mongodb.com&apos;, &apos;username&apos;: &apos;visemet&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-38697&quot; title=&quot;Powercycle kill by PID might try to kill the wrong process&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-38697&quot;&gt;&lt;del&gt;SERVER-38697&lt;/del&gt;&lt;/a&gt; Use process creation time to detect pid reuse.&lt;/p&gt;

&lt;p&gt;Changes start_cmd() to use psutil.Popen() rather than subprocess.Popen()&lt;br/&gt;
in order to cache the creation time of the child process.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/d43369c671a596ee816f44038fca3423a0a33126&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/d43369c671a596ee816f44038fca3423a0a33126&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2165684" author="max.hirschhorn@10gen.com" created="Thu, 28 Feb 2019 03:18:21 +0000"  >&lt;p&gt;Jonathan had proposed using the process creation time to detect if the pid is being reused. &lt;tt&gt;psutil&lt;/tt&gt; would actually do that for us automatically but because &lt;a href=&quot;https://github.com/mongodb/mongo/blob/r4.1.8/pytests/powertest.py#L673&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;we&apos;re storing a &lt;tt&gt;subprocess.Popen&lt;/tt&gt; instance in &lt;tt&gt;Processes._PROC_LIST&lt;/tt&gt;&lt;/a&gt; rather than a &lt;tt&gt;psutil.Popen&lt;/tt&gt; instance (which derives from &lt;tt&gt;psutil.Process&lt;/tt&gt;) so we aren&apos;t getting any benefit. &lt;a href=&quot;https://github.com/mongodb/mongo/blob/r4.1.8/pytests/powertest.py#L266&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;The &lt;tt&gt;kill_process()&lt;/tt&gt; function&lt;/a&gt; could then just take the &lt;tt&gt;psutil.Process&lt;/tt&gt; instance directly instead of the pid.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;b&gt;Note&lt;/b&gt; the way this class is bound to a process is uniquely via its PID. That means that if the process terminates and the OS reuses its PID you may end up interacting with another process. The only exceptions for which process identity is preemptively checked (via PID + creation time) is for the following methods: &lt;tt&gt;nice()&lt;/tt&gt; (set), &lt;tt&gt;ionice()&lt;/tt&gt; (set), &lt;tt&gt;cpu_affinity()&lt;/tt&gt; (set), &lt;tt&gt;rlimit()&lt;/tt&gt; (set), &lt;tt&gt;children()&lt;/tt&gt;, &lt;tt&gt;parent()&lt;/tt&gt;, &lt;tt&gt;parents()&lt;/tt&gt;, &lt;tt&gt;suspend()&lt;/tt&gt; &lt;tt&gt;resume()&lt;/tt&gt;, &lt;tt&gt;send_signal()&lt;/tt&gt;, &lt;tt&gt;terminate()&lt;/tt&gt; &lt;tt&gt;kill()&lt;/tt&gt;. To prevent this problem for all other methods you can use &lt;tt&gt;is_running()&lt;/tt&gt; before querying the process or &lt;tt&gt;process_iter()&lt;/tt&gt; in case you&#8217;re iterating over all processes. It must be noted though that unless you deal with very &#8220;old&#8221; (inactive) &lt;tt&gt;Process&lt;/tt&gt; instances this will hardly represent a problem.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://psutil.readthedocs.io/en/latest/#psutil.Process&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://psutil.readthedocs.io/en/latest/#psutil.Process&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;That all being said, &lt;a href=&quot;https://docs.microsoft.com/en-us/windows/desktop/procthread/job-objects&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;job objects&lt;/a&gt; are &lt;em&gt;the&lt;/em&gt; reliable way to do process management on Windows. Unfortunately, nested job objects are only supported starting in Windows Server 2012, and that&apos;s newer than the version of Windows we run our tests with on older branches. This means we&apos;d risk leaking processes across Evergreen tasks if we attempted to have the created process break away from the job object created by the Evergreen agent. It&apos;d be nice to one day use &lt;a href=&quot;https://docs.microsoft.com/en-us/windows/desktop/api/jobapi2/nf-jobapi2-terminatejobobject&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the &lt;tt&gt;TerminateJobObject()&lt;/tt&gt; function&lt;/a&gt; to terminate all children processes between powercycle loops. The current approach of scanning over the list of all processes has checking its ppid has gaps if the parent process has already died, or is prone to races if a process is in the midst of spawning a child process. (An environment variable is the way the Evergreen agent approaches this issue, which in turn was taken from how Jenkins does it.)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://nikhilism.com/post/2017/windows-job-objects-process-tree-management/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://nikhilism.com/post/2017/windows-job-objects-process-tree-management/&lt;/a&gt; and &lt;a href=&quot;https://lwn.net/Articles/754980/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://lwn.net/Articles/754980/&lt;/a&gt; are some other references I found interesting to read through when thinking about this subject.&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">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.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>
    <customfieldvalue key="15141"><![CDATA[v3.6]]></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>Thu, 28 Feb 2019 03:18:21 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 49 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>40.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>jonathan.abrahams</customfieldvalue>
            <customfieldvalue>max.hirschhorn@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hugvd3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hu6wxb:</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="2767">STM 2019-03-11</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|hughmf:</customfieldvalue>

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