<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:37:11 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-1812] Panic in Transaction Callback Results in Permanent Write Conflict</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-1812</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;I&apos;ve started to develop our first Transaction with the Go driver (v1.4.4) and an Atlas instance (v4.2.11). I&apos;m quite new to using transactions, so apologies if what follows is not clear.&lt;/p&gt;

&lt;p&gt;A panic in the function parameter for WithTransaction appears to have resulted in the session not closing. All subsequent transactions are now failing with a &lt;em&gt;Write Conflict&lt;/em&gt; &#8211; despite the panic being fixed, and a half-hour passing since the panic.&lt;/p&gt;

&lt;p&gt;Following is what I&apos;m using for my transactions:&lt;/p&gt;



&lt;p&gt;&lt;tt&gt;session, err := client.StartSession()&lt;/tt&gt;&lt;br/&gt;
{{ if err != nil {}}&lt;br/&gt;
&lt;tt&gt;&#160; panic(err)&lt;/tt&gt;&lt;br/&gt;
{{ }}}&lt;br/&gt;
{{ defer session.EndSession(p.Ctx)}}&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;res, err := session.WithTransaction(p.Ctx, p.CB)&lt;/tt&gt;&lt;br/&gt;
{{ if err != nil {}}&lt;br/&gt;
&lt;tt&gt;&#160; return err&lt;/tt&gt;&lt;br/&gt;
{{ }}}&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;The panic occurred in &lt;tt&gt;p.CB&lt;/tt&gt;, above. I would have expected the deferred &lt;tt&gt;session.EndSession&lt;/tt&gt; call to have been called regardless of the panic. But somehow, all subsequent transactions are returning a &lt;em&gt;Write Conflict&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;What happens if there is no timeout in the context? Does the session remain open indefinitely?&lt;/p&gt;</description>
                <environment></environment>
        <key id="1570447">GODRIVER-1812</key>
            <summary>Panic in Transaction Callback Results in Permanent Write Conflict</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="13203">Gone away</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="davidwen.riccardizhu@gooduncle.com">David Wen Riccardi-Zhu</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Dec 2020 17:06:27 +0000</created>
                <updated>Fri, 27 Oct 2023 20:01:18 +0000</updated>
                            <resolved>Thu, 17 Dec 2020 18:50:58 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="3533080" author="JIRAUSER1253485" created="Wed, 16 Dec 2020 19:02:27 +0000"  >&lt;p&gt;I think this can be closed &#8211; the issue was likely a concurrent update happening without the Session Context, and previously masked by a race condition.&lt;/p&gt;</comment>
                            <comment id="3532970" author="JIRAUSER1253485" created="Wed, 16 Dec 2020 18:08:41 +0000"  >&lt;p&gt;I have attempted multiple failovers and pausing and restarting my cluster, but all transactions are still returning &quot;Write Conflict&quot;.&lt;/p&gt;

&lt;p&gt;If it&apos;s useful, this is what I see with db.serverStatus() for transactions:&lt;/p&gt;

&lt;p&gt;{{{}}&lt;br/&gt;
{{ &quot;retriedCommandsCount&quot; : NumberLong(0),}}&lt;br/&gt;
{{ &quot;retriedStatementsCount&quot; : NumberLong(0),}}&lt;br/&gt;
{{ &quot;transactionsCollectionWriteCount&quot; : NumberLong(28),}}&lt;br/&gt;
{{ &quot;currentActive&quot; : NumberLong(0),}}&lt;br/&gt;
{{ &quot;currentInactive&quot; : NumberLong(0),}}&lt;br/&gt;
{{ &quot;currentOpen&quot; : NumberLong(0),}}&lt;br/&gt;
{{ &quot;totalAborted&quot; : NumberLong(2),}}&lt;br/&gt;
{{ &quot;totalCommitted&quot; : NumberLong(0),}}&lt;br/&gt;
{{ &quot;totalStarted&quot; : NumberLong(2),}}&lt;br/&gt;
{{ &quot;totalPrepared&quot; : NumberLong(0),}}&lt;br/&gt;
{{ &quot;totalPreparedThenCommitted&quot; : NumberLong(0),}}&lt;br/&gt;
{{ &quot;totalPreparedThenAborted&quot; : NumberLong(0),}}&lt;br/&gt;
{{ &quot;currentPrepared&quot; : NumberLong(0)}}&lt;br/&gt;
&lt;tt&gt;}&lt;/tt&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hy80fj:</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>