<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:38:46 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-56251] Alleviate problems that arise when OperationContext::markKilled is called with a non-Interruption error</title>
                <link>https://jira.mongodb.org/browse/SERVER-56251</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/5b7c968e4ee5f3137ff1e0a330959dc7c6ea8d0c/src/mongo/db/repl/repl_client_info.cpp#L130&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Some&lt;/a&gt; places in the code rely on catching an exception in ErrorCategory::Interruption to check whether an OperationContext has been interrupted. This is a problem if any callsites ever call OperationContext::markKilled with an error code that isn&apos;t in this error category, but there&apos;s not currently anything preventing that from happening. Technically, using the Interruption category to check for OperationContext interrupt is also error prone since it&apos;s possible that other things could throw an Interruption error, so call sites which need to check for interrupt should probably catch all exceptions and then actually check the OperationContext to see if it&apos;s been interrupted.&lt;/p&gt;

&lt;p&gt;This ticket should either:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Add an invariant to markKilled to make sure all error codes passed to it belong to ErrorCategory::Interruption, and fix the broken call sites, or&lt;/li&gt;
	&lt;li&gt;Fix all places we catch Interruption errors and rely on that to assume the OperationContext has been interrupted to catch all DBExceptions and check the OperationContext itself for interrupt&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&amp;#8212;&lt;/p&gt;

&lt;p&gt;We determined that the appropriate resolution is to remove the Interruption category. The reason being Interruption has built up a lot of cruft and has lost meaning over time. Currently, several bugs have been logged to address sections of the code base that use this category. Once those are complete, the actual removal of the category should be trivial.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1686050">SERVER-56251</key>
            <summary>Alleviate problems that arise when OperationContext::markKilled is called with a non-Interruption error</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="matthew.saltz@mongodb.com">Matthew Saltz</reporter>
                        <labels>
                            <label>needs-epic</label>
                            <label>sa-remove-fv-backlog-22</label>
                            <label>techdebt</label>
                    </labels>
                <created>Wed, 21 Apr 2021 20:42:16 +0000</created>
                <updated>Tue, 30 Jan 2024 17:45:55 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>13</watches>
                                                                                                                <comments>
                            <comment id="4819007" author="gregory.noma" created="Mon, 12 Sep 2022 14:44:45 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=louis.williams%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;louis.williams@mongodb.com&quot;&gt;louis.williams@mongodb.com&lt;/a&gt; in general I think that scenario isn&apos;t an issue because that issue requires &lt;a href=&quot;https://github.com/mongodb/mongo/blob/16b22af0483333fba942c835cdc4ab5ae3dfcf23/src/mongo/db/service_context.cpp#L350&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;setting the global kill flag&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="4818989" author="schwerin" created="Mon, 12 Sep 2022 14:40:20 +0000"  >
&lt;p&gt;I think &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-69496&quot; title=&quot;InterruptedAtShutdown can be thrown without the operation context being marked as killed&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-69496&quot;&gt;&lt;del&gt;SERVER-69496&lt;/del&gt;&lt;/a&gt; has a local problem that we would have caught at code&lt;br/&gt;
review today.&lt;/p&gt;
</comment>
                            <comment id="4818921" author="louis.williams" created="Mon, 12 Sep 2022 14:26:42 +0000"  >&lt;p&gt;Even if we remove the error category, what prevents someone from writing code that throws an InterruptedAtShutdown error without marking the OpCtx as killed and callers treating this as an error? See &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-69496&quot; title=&quot;InterruptedAtShutdown can be thrown without the operation context being marked as killed&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-69496&quot;&gt;&lt;del&gt;SERVER-69496&lt;/del&gt;&lt;/a&gt;. &lt;/p&gt;</comment>
                            <comment id="4798705" author="gregory.noma" created="Fri, 2 Sep 2022 17:15:35 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=matt.diener%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;matt.diener@mongodb.com&quot;&gt;matt.diener@mongodb.com&lt;/a&gt; I just merged in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-67611&quot; title=&quot;Stop using ErrorCategory::Interruption in Execution codebase&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-67611&quot;&gt;&lt;del&gt;SERVER-67611&lt;/del&gt;&lt;/a&gt; which is the last ticket currently listed as a dependency. However, I see that there are still several usages of &lt;tt&gt;ErrorCodes::isInterruption&lt;/tt&gt; which I imagine will also need to be removed prior to this ticket.&lt;/p&gt;</comment>
                            <comment id="4645369" author="JIRAUSER1264675" created="Tue, 28 Jun 2022 16:41:47 +0000"  >&lt;p&gt;There are several pieces of code that pass a non-`Interruption` error into `markKilled`. We could expand the meaning of `Interruption`, but that would further erode its usefulness. Alternatively, we can visit all call sites of `markKilled` which currently do not pass an `Interruption` error and swap out the error code for something that fits the category. Each of these instances present the risk of breaking some code that uses the specific error code, and each change would require investigation to ensure we&apos;re not breaking anything.&lt;/p&gt;

&lt;p&gt;I am going as far as to argue that those investigations would be more expensive than the investigations associated with removing code that references `ErrorCategory::Interruption`. The first is an investigation into hypothetical places where we check an error code, where the later is an investigation into specific pieces of code that are very likely to be simultaneously encountering false positive and false negative matches of specifically `ErrorCategory::Interruption`.&lt;/p&gt;

&lt;p&gt;If it is true that the ErrorCategory is being used as an indicator that the opCtx is killed (it seems to be the case from my investigation), those pieces of code need to be fixed anyway. The opCtx can be killed without encountering an Interruption error (even if we expand its definition), and an Interruption error can be observed in cases where the opCtx is not killed.&lt;/p&gt;

&lt;p&gt;We&apos;re making the decision to follow Andy&apos;s suggestion and kill the ErrorCategory altogether. I am ticketing out work to remove references.&lt;/p&gt;</comment>
                            <comment id="4447359" author="schwerin" created="Thu, 31 Mar 2022 13:39:34 +0000"  >&lt;p&gt;I&apos;d like to go a step further, and propose that we remove the error category entirely, to avoid future confusion.&lt;/p&gt;</comment>
                            <comment id="4193008" author="schwerin" created="Tue, 16 Nov 2021 19:58:43 +0000"  >&lt;p&gt;I&apos;m just seeing this ticket now. I think the right approach is the second one described in the description:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Fix all places we catch Interruption errors and rely on that to assume the OperationContext has been interrupted to catch all DBExceptions and check the OperationContext itself for interrupt&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Looking at the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/5b7c968e4ee5f3137ff1e0a330959dc7c6ea8d0c/src/mongo/base/error_codes.yml&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;error codes&lt;/a&gt; labeled with the &lt;tt&gt;Interruption&lt;/tt&gt; error category, I don&apos;t see a fundamental relationship between them. They just seem to be codes that someone decided they would call `markKilled` with in some circumstances.&lt;/p&gt;</comment>
                            <comment id="4123229" author="max.hirschhorn@10gen.com" created="Thu, 14 Oct 2021 04:59:02 +0000"  >&lt;p&gt;Wanted to note that the lack of clarity around the valid inputs to OperationContext::markKilled() has been the source of a production crash tracked by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60685&quot; title=&quot;TransactionCoordinator may interrupt locally executing update with non-Interruption error category, leading to server crash&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60685&quot;&gt;&lt;del&gt;SERVER-60685&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="3745438" author="matthew.saltz" created="Wed, 28 Apr 2021 21:54:30 +0000"  >&lt;p&gt;The reason this ticket came up was that a newly added component was doing markKilled with CallbackCanceled and it caused something in a random place to not catch an exception because it was only expecting Interruption-category codes. So as a quick fix we changed it to call markKilled with &quot;Interrupted&quot; but that&apos;s less than ideal, hence these suggestions &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; &lt;/p&gt;</comment>
                            <comment id="3738386" author="louis.williams" created="Mon, 26 Apr 2021 13:25:14 +0000"  >&lt;p&gt;I don&apos;t think your first suggestion will be possible until we fix some of the index building interrupt behavior. Your second option sounds fine, but it may not be necessary. I have a theory that any recipients of non-interruption error codes are probably already doing this, otherwise, they might not work correctly. This is just based on my observations about the index building code.&lt;/p&gt;</comment>
                            <comment id="3733327" author="matthew.saltz" created="Thu, 22 Apr 2021 15:32:47 +0000"  >&lt;p&gt;Thanks for that info. I guess another option for the first bullet point would also be to add any error we use to kill an OperationContext to the Interruption error category - but that seems like it could have other knock-on side effects.&lt;/p&gt;

&lt;p&gt;Based on your input it sounds like we should go with the second approach of fixing call sites that use Interruption errors as a way to find out whether the OperationContext was killed. In which case this ticket could possibly turn into doing an audit of those sites and creating new tickets for each case, depending on how many there are and how difficult it seems to be to update the logic. (I think there are around 10-20 based on a grep I did a few weeks ago.) What do you think?&lt;/p&gt;</comment>
                            <comment id="3733066" author="louis.williams" created="Thu, 22 Apr 2021 14:22:00 +0000"  >&lt;p&gt;For better or for worse, we use the IndexBuildAborted error code to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/aa2bbde8810ae9de83d6d0f1adbd364ed52cde32/src/mongo/db/repl_index_build_state.cpp#L356&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;internally abort index builds&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This allows us to both interrupt the index builder thread and communicate that it was killed by a caller that is taking responsibility for cleaning up its state. As a result, it skips certain cleanup tasks. It would be better to communicate that information through other means, but that is where the code is currently.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="2078728">SERVER-67606</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2078822">SERVER-67611</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2078827">SERVER-67615</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2078832">SERVER-67617</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2078834">SERVER-67618</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1654568">SERVER-55379</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1898134">SERVER-60685</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2112829">SERVER-68808</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2560714">SERVER-85912</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="2146145">SERVER-70010</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1653364">SERVER-55323</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2384900">SERVER-78722</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>12.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.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>Thu, 22 Apr 2021 14:22:00 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 21 weeks, 2 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/SERVER-67606'>SERVER-67606</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-67611'>SERVER-67611</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-67615'>SERVER-67615</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-67617'>SERVER-67617</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-67618'>SERVER-67618</a></s>]]></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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-3051</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10553" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Flagged</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10442"><![CDATA[Impediment]]></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>judah.schvimer@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 year, 21 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>schwerin@mongodb.com</customfieldvalue>
            <customfieldvalue>backlog-server-servicearch</customfieldvalue>
            <customfieldvalue>gregory.noma@mongodb.com</customfieldvalue>
            <customfieldvalue>louis.williams@mongodb.com</customfieldvalue>
            <customfieldvalue>matt.diener@mongodb.com</customfieldvalue>
            <customfieldvalue>matthew.saltz@mongodb.com</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|hz5rn3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hx0k0c:</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="6267">Service Arch 2022-06-13</customfieldvalue>
    <customfieldvalue id="6283">Service Arch 2022-06-27</customfieldvalue>
    <customfieldvalue id="6303">Service Arch 2022-07-11</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|hz5dw7:</customfieldvalue>

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