<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:38:35 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>[GODRIVER-2432] Improve panic handling in background processes</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-2432</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;There is a mixture of &lt;a href=&quot;https://go.dev/blog/defer-panic-and-recover&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;defer recover&lt;/a&gt; blocks without a clear purpose and possibly unhandled panics in background goroutines in the Go driver (e.g. &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-2438&quot; title=&quot;Pool &amp;quot;closeConnection&amp;quot; method cause panics on removePerishedConns()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-2438&quot;&gt;&lt;del&gt;GODRIVER-2438&lt;/del&gt;&lt;/a&gt;). Improve the use of &quot;defer recover&quot; blocks in the Go driver to prevent recoverable panics from unnecessarily propagating, prevent hiding panics by exposing recovered panics, and add tests and documentation that exercise and describe the possible panic and recovery conditions.&lt;/p&gt;

&lt;p&gt;There are currently 3 &quot;defer recover&quot; blocks in the Go Driver that do not have a clear purpose or comment and discard the caught error. That means there are possibly panics happening in the Go Driver that are caught and ignored, increasing the risk of undiscovered driver bugs or unexpected behavior.&lt;/p&gt;

&lt;p&gt;Defer recover blocks and associated Github/Gerrithub history:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/7fbb175bfd1a3ebe204a878e3dd98a6d6089da6f/x/mongo/driver/topology/server.go#L477-L485&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;server.go#L477-485&lt;/a&gt;
	&lt;ul&gt;
		&lt;li&gt;Commit: Changed in &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/94ae2dc59114fbf6dd39707929068adfa20a92e8&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;a20a92e8&lt;/a&gt;, introduced in &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/854de671997526b583179eafba491c2d3ee55f09&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;3ee55f09&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;Ticket: &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-285&quot; title=&quot;Client should have a Close method&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-285&quot;&gt;&lt;del&gt;GODRIVER-285&lt;/del&gt;&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;Review: &lt;a href=&quot;https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/408109/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/408109/&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/7fbb175bfd1a3ebe204a878e3dd98a6d6089da6f/x/mongo/driver/topology/server.go#L590-L593&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;server.go#L590-L593&lt;/a&gt;
	&lt;ul&gt;
		&lt;li&gt;Commit: &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/854de671997526b583179eafba491c2d3ee55f09&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;3ee55f09&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;Ticket: ?&lt;/li&gt;
		&lt;li&gt;Review: ?&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/7fbb175bfd1a3ebe204a878e3dd98a6d6089da6f/x/mongo/driver/topology/topology.go#L566-L571&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;topology.go#L566-L571&lt;/a&gt;
	&lt;ul&gt;
		&lt;li&gt;Commit: &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/976cd7c625aa8bb4b19ed2cb57d0bac048e91ca9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;48e91ca9&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;Ticket: &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-625&quot; title=&quot;Support polling SRV records for mongos discovery&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-625&quot;&gt;&lt;del&gt;GODRIVER-625&lt;/del&gt;&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;Review: &lt;a href=&quot;https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/450676/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/450676/&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;All of that context doesn&apos;t provide any answers about why those defer recover blocks were added. The surrounding code has been changed significantly so they may no longer be necessary. A recent &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/pull/910&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;draft PR&lt;/a&gt; with the defer recover blocks removed passes all tests, but it&apos;s still possible the called code could panic due to some untested condition. We should collect more information about why the defer recover blocks were added, then remove them if possible.&lt;/p&gt;

&lt;p&gt;Definition of done:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Collect more historical context to understand why the defer recover blocks were added.&lt;/li&gt;
	&lt;li&gt;Add tests to cover any discovered untested panic conditions.&lt;/li&gt;
	&lt;li&gt;Add or move &quot;defer recover&quot; blocks that are necessary to handle panics in background goroutines. Include detailed comments describing what panic conditions we&apos;re expecting to handle.&lt;/li&gt;
	&lt;li&gt;Remove unnecessary &quot;defer recover&quot; blocks.&lt;/li&gt;
	&lt;li&gt;Fix any discovered panics that are bugs in the Go driver.&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="2051824">GODRIVER-2432</key>
            <summary>Improve panic handling in background processes</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</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="preston.vasquez@mongodb.com">Preston Vasquez</assignee>
                                    <reporter username="matt.dale@mongodb.com">Matt Dale</reporter>
                        <labels>
                            <label>techdebt</label>
                    </labels>
                <created>Fri, 20 May 2022 18:49:23 +0000</created>
                <updated>Tue, 5 Dec 2023 19:32:36 +0000</updated>
                            <resolved>Thu, 16 Nov 2023 20:38:25 +0000</resolved>
                                                    <fixVersion>2.0.0</fixVersion>
                    <fixVersion>1.14.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1052016">GODRIVER-1439</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2056774">GODRIVER-2438</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="484105">GODRIVER-198</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="486150">GODRIVER-204</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10012"><![CDATA[Major Change]]></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_10257" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Documentation Changes</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11861"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_14266" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Documentation Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;1. What would you like to communicate to the user about this feature?&lt;br/&gt;
2. Would you like the user to see examples of the syntax and/or executable code and its output?&lt;br/&gt;
3. Which versions of the driver/connector does this apply to?&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>GODRIVER-1787</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0en08:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>