<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:28:18 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-52532] Investigate if code during signal handling should use quickExitWithoutLogging</title>
                <link>https://jira.mongodb.org/browse/SERVER-52532</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44570&quot; title=&quot;Create a non process-fatal variant of invariant()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44570&quot;&gt;&lt;del&gt;SERVER-44570&lt;/del&gt;&lt;/a&gt; added code to quickExit() [*] to call checkForTripwireAssertions(), which checks the tripwire atomic int and logs if it&apos;s non-zero.  However, some signal handling code in util/signal_handlers_synchronous.cpp calls quickExit().  Therefore, if any of the code in checkForTripwireAssertions() isn&apos;t safe to call in a signal handler, then it should either be made safe, or if this isn&apos;t possible, then the signal handling code should instead call quickExitWithoutLogging().&lt;/p&gt;

&lt;p&gt;[*]: Technically, it added code to the callers of quickExit(), by renaming the original quickExit() to quickExitWithoutLogging(), and making a new inline quickExit() that calls quickExitWithoutLogging().&lt;/p&gt;</description>
                <environment></environment>
        <key id="1531091">SERVER-52532</key>
            <summary>Investigate if code during signal handling should use quickExitWithoutLogging</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="12300">Won&apos;t Do</resolution>
                                        <assignee username="billy.donahue@mongodb.com">Billy Donahue</assignee>
                                    <reporter username="kevin.pulo@mongodb.com">Kevin Pulo</reporter>
                        <labels>
                            <label>re-triaged-ticket</label>
                            <label>servicearch-wfbf-day</label>
                    </labels>
                <created>Mon, 2 Nov 2020 04:22:22 +0000</created>
                <updated>Thu, 23 Feb 2023 21:30:05 +0000</updated>
                            <resolved>Fri, 10 Feb 2023 16:57:58 +0000</resolved>
                                                                    <component>Internal Code</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="5187136" author="billy.donahue" created="Fri, 10 Feb 2023 16:57:58 +0000"  >&lt;p&gt;This is probably best handled as part of a project to fix up our signal handlers and their unsafe behaviors in a more thorough way. We&apos;re talking about maybe having a sidecar process that just handles log message and/or signal diagnostics.&lt;/p&gt;

&lt;p&gt;The idea that our signal handlers are doing complicated work on their own is IMO not really feasible long-term. It&apos;s not even safe to get a backtrace, because unwinding can require opening debuginfo sections that are compressed, and so there&apos;s allocations involved etc. It&apos;s really best if the signal handlers just set a flag and await roadside assistance.&lt;/p&gt;</comment>
                            <comment id="5185642" author="billy.donahue" created="Fri, 10 Feb 2023 08:24:33 +0000"  >&lt;blockquote&gt;&lt;p&gt;The main things of concern are:&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;1/ loading the atomic (which I think is like/just a memory barrier, so maybe safe?)&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;2/ calling the logv2 functions without the logv2::LogTruncation::Disabled option (based on how writeMallocFreeStreamToLog calls logging)&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I did some research to try to answer these concerns.&lt;/p&gt;

&lt;p&gt;1/ Yes, loading the atomic with the default .load memory order is safe and consistent. No problem there.&lt;/p&gt;

&lt;p&gt;2/ The logging is not really OK according to spec, but we do it all over these signal handlers already, and tassert isn&apos;t making that situation worse than it already is. It&apos;s just a  little more of the same. the MallocFreeStreamToLog has truncation disabled because it&apos;s dumping a stack trace and other potentially large data accumulated in the stream, so we&apos;re trying to avoid truncation of that precious diagnostic data.&lt;/p&gt;

&lt;p&gt;I also don&apos;t think the signal handers are calling quickExit. Maybe they used to when this was written? There&apos;s one quickExit call which happens when we catch recursive logging but that&apos;s unusual. That would occur only if we were inside a log statement and a synchronous signal was generated during the logging.&lt;/p&gt;

&lt;p&gt;I think we can keep this one closed. We do know that the signal handlers don&apos;t make a very big effort to be sync-signal-safe. I think the allocator and C library are making it possible for use to be sloppy about certain technically unsafe things we&apos;re doing in the handlers. The handlers should probably just be setting bits, signalling an outside process to take action, and halting. Let the outside process do the rest.&lt;/p&gt;</comment>
                            <comment id="3471396" author="kevin.pulo@10gen.com" created="Mon, 2 Nov 2020 12:29:08 +0000"  >&lt;p&gt;The main things of concern are:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/7d8e64df2d2d56a821f638ef88aa619403d03d31/src/mongo/util/assert_util.cpp#L293&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;loading the atomic&lt;/a&gt; (which I think is like/just a memory barrier, so maybe safe?)&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/7d8e64df2d2d56a821f638ef88aa619403d03d31/src/mongo/util/assert_util.cpp#L298-L309&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;calling the logv2 functions&lt;/a&gt; without the logv2::LogTruncation::Disabled option (based on how &lt;a href=&quot;https://github.com/mongodb/mongo/blob/7d8e64df2d2d56a821f638ef88aa619403d03d31/src/mongo/util/signal_handlers_synchronous.cpp#L194-L199&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;writeMallocFreeStreamToLog calls logging&lt;/a&gt;)&lt;/li&gt;
&lt;/ol&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="997318">SERVER-44570</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 10 Feb 2023 08:24:33 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        51 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_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>elizabeth.roytburd@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            51 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>billy.donahue@mongodb.com</customfieldvalue>
            <customfieldvalue>kevin.pulo@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hyfiqf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr9fdj:</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="6750">Service Arch 2023-02-20</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|hyf4zr:</customfieldvalue>

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