<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:26:05 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>[DRIVERS-2647] Drivers should unpin connections when ending a session</title>
                <link>https://jira.mongodb.org/browse/DRIVERS-2647</link>
                <project id="10980" key="DRIVERS">Drivers</project>
                    <description>&lt;div class=&quot;panel&quot; style=&quot;background-color: #fafbfc;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelContent&quot; style=&quot;background-color: #fafbfc;&quot;&gt;
&lt;h3&gt;&lt;a name=&quot;Summary&quot;&gt;&lt;/a&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;The Transactions and Load Balancer specs together describe the process for &quot;pinning&quot; a connection to a ClientSession when connected to a load-balancer so that all transaction operations are sent to the same &lt;tt&gt;mongos&lt;/tt&gt;. The Load Balancers spec also requires that drivers not use the pinned connection for other transactions concurrently&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Drivers MUST NOT use the same connection for two concurrent transactions run under different sessions from the same client.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;which drivers may implement by giving exclusive access to the pinned connection to the ClientSession.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/mongodb/specifications/blob/840e6d49c354656bff11b2622f0d3001b39d9403/source/transactions/transactions.rst#when-to-unpin&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;When to unpin&lt;/a&gt; section in the Transactions spec enumerates the conditions when a connection should be unpinned from a ClientSession. However, the list doesn&apos;t specify unpinning when a ClientSession is explicitly ended with &lt;tt&gt;endSession&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;According to the &lt;a href=&quot;https://github.com/mongodb/specifications/blob/840e6d49c354656bff11b2622f0d3001b39d9403/source/transactions/transactions.rst#when-to-unpin&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;When to unpin&lt;/a&gt; section, the following sequence of events may never lead to a connection being unpinned from a ClientSession, effectively creating a connection &quot;leak&quot;:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Start a &lt;tt&gt;ClientSession&lt;/tt&gt;.&lt;/li&gt;
	&lt;li&gt;Run &lt;tt&gt;startTransaction&lt;/tt&gt; in the session.&lt;/li&gt;
	&lt;li&gt;Run &lt;tt&gt;insertMany&lt;/tt&gt; in the transaction.&lt;/li&gt;
	&lt;li&gt;Run &lt;tt&gt;commitTransaction&lt;/tt&gt;.&lt;/li&gt;
	&lt;li&gt;Run &lt;tt&gt;endSession&lt;/tt&gt;.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;We should amend the &lt;a href=&quot;https://github.com/mongodb/specifications/blob/840e6d49c354656bff11b2622f0d3001b39d9403/source/transactions/transactions.rst#when-to-unpin&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;When to unpin&lt;/a&gt; section to explicitly require drivers to unpin connections from a ClientSession when &lt;tt&gt;endSession&lt;/tt&gt; is called.&lt;/p&gt;
&lt;h3&gt;&lt;a name=&quot;Motivation&quot;&gt;&lt;/a&gt;&lt;b&gt;Motivation&lt;/b&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;a name=&quot;Whoistheaffectedenduser%3F&quot;&gt;&lt;/a&gt;Who is the affected end user?&lt;/h4&gt;

&lt;p&gt;Users running transactions on load-balanced databases (e.g. Atlas Serverless or dedicated clusters connecting via a &lt;a href=&quot;https://www.mongodb.com/docs/atlas/security-private-endpoint/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;VPC private link&lt;/a&gt;).&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Howdoesthisaffecttheenduser%3F&quot;&gt;&lt;/a&gt;How does this affect the end user?&lt;/h4&gt;

&lt;p&gt;Connections used to run transactions may never be returned to the connection pool, resulting in a connection leak. If the driver is configured with a max connection pool size (or using the default), the driver may eventually run out of unpinned connections and hang.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Howlikelyisitthatthisproblemorusecasewilloccur%3F&quot;&gt;&lt;/a&gt;How likely is it that this problem or use case will occur?&lt;/h4&gt;

&lt;p&gt;If a driver unpins connections strictly as described in &lt;a href=&quot;https://github.com/mongodb/specifications/blob/840e6d49c354656bff11b2622f0d3001b39d9403/source/transactions/transactions.rst#when-to-unpin&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;When to unpin&lt;/a&gt; in the Transactions spec, a connection leak will happen anytime a customer creates a session, runs a transaction, and ends the session while connected to a load-balanced database.&lt;/p&gt;

&lt;p&gt;Some drivers already unpin connections when ending sessions and are unaffected.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Iftheproblemdoesoccur%2Cwhataretheconsequencesandhowseverearethey%3F&quot;&gt;&lt;/a&gt;If the problem does occur, what are the consequences and how severe are they?&lt;/h4&gt;

&lt;p&gt;A driver will either open and then then not use many extra connections or it will hang and stop working.&lt;/p&gt;

&lt;h4&gt;&lt;a name=&quot;Isthisissueurgent%3F&quot;&gt;&lt;/a&gt;Is this issue urgent?&lt;/h4&gt;

&lt;p&gt;The issue in the Go driver (&lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-2867&quot; title=&quot;Connection leak caused by  connection-to-transaction pinning when connected to a load balancer&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-2867&quot;&gt;&lt;del&gt;GODRIVER-2867&lt;/del&gt;&lt;/a&gt;) is moderately urgent because it is the root cause of a &lt;tt&gt;mongosync&lt;/tt&gt; bug that is blocking a customer migration (HELP-46291). Its urgency depends on how many other drivers are impacted by the problem and the rate of adoption of impacted services, like Serverless. Overall, it seems moderately urgent to figure out how many drivers are impacted.&lt;/p&gt;

&lt;h4&gt;&lt;a name=&quot;Isthisticketrequiredbyadownstreamteam%3F&quot;&gt;&lt;/a&gt;Is this ticket required by a downstream team?&lt;/h4&gt;

&lt;p&gt;No.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Isthisticketonlyfortests%3F&quot;&gt;&lt;/a&gt;Is this ticket only for tests?&lt;/h4&gt;

&lt;p&gt;No.&lt;/p&gt;
&lt;h3&gt;&lt;a name=&quot;AcceptanceCriteria&quot;&gt;&lt;/a&gt;&lt;b&gt;Acceptance Criteria&lt;/b&gt;&lt;/h3&gt;
&lt;ul&gt;
	&lt;li&gt;Amend the &quot;When to unpin&quot; section of the Transactions spec to explicitly require drivers to unpin connections from a ClientSession when &lt;tt&gt;endSession&lt;/tt&gt; is called.&lt;/li&gt;
	&lt;li&gt;Add a load balancer spec test that asserts that pinned connections are returned to the connection pool when &lt;tt&gt;endSession&lt;/tt&gt; is called.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="2364588">DRIVERS-2647</key>
            <summary>Drivers should unpin connections when ending a session</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="qingyang.hu@mongodb.com">Qingyang Hu</assignee>
                                    <reporter username="matt.dale@mongodb.com">Matt Dale</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Jun 2023 23:24:57 +0000</created>
                <updated>Wed, 31 Jan 2024 19:39:37 +0000</updated>
                                                                <component>Load Balancer</component>
                    <component>Transactions</component>
                                        <votes>1</votes>
                                    <watches>10</watches>
                                                                                                                <comments>
                            <comment id="5578380" author="george.wangensteen" created="Wed, 19 Jul 2023 22:37:38 +0000"  >&lt;p&gt;I discussed this with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=max.hirschhorn%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;max.hirschhorn@mongodb.com&quot;&gt;max.hirschhorn@mongodb.com&lt;/a&gt; and we think that it is important that drivers also require unpinning after commitTransaction succeeds. If an application mints new sessions explicitly to run transactions, but does not explicitly end those sessions (relying on i.e. garbage collection), connections could also be &apos;leaked&apos; / not unpinned for prolonged periods of time. &lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10620">
                    <name>Issue split</name>
                                            <outwardlinks description="split to">
                                        <issuelink>
            <issuekey id="2487003">CDRIVER-4756</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487025">CSHARP-4829</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487020">CXX-2779</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487032">GODRIVER-3034</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487047">MOTOR-1204</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487043">NODE-5722</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487059">PHPLIB-1299</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487054">PYTHON-4020</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487063">RUBY-3343</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487065">RUST-1790</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487038">JAVA-5228</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="2364159">GODRIVER-2867</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <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_17052" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Downstream Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;&lt;b&gt;Summary of necessary driver changes&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&#160;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;b&gt;Commits for syncing spec/prose tests&lt;/b&gt; &lt;br/&gt;
&lt;em&gt;(and/or refer to an existing language POC if needed)&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&#160;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;b&gt;Context for other referenced/linked tickets&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&#160;&lt;/li&gt;
&lt;/ul&gt;

</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10951" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Driver Changes</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10748"><![CDATA[Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_23952" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Driver Compliance</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<style type='text/css'>
         #scriptField, #scriptField *{
                border: 1px solid black;
            }

            #scriptField{
                border-collapse: collapse;
            }

            #scriptField td {
                text-align: center; /* Center-align text in table cells */
            }

            #scriptField td.key {
                text-align: left; /* Left-align text in the Key column */
            }

            #scriptField a {
                text-decoration: none; /* Remove underlines from links */
                border: none; /* Remove border from links */
            }
            
            /* Add green background color to cells with FixVersion */
            #scriptField td.hasFixVersion {
                background-color: #00FF00; /* Green color code */
            }

            /* Center-align the first row headers */
            #scriptField th {
                text-align: center;
            }
        </style>
<table id='scriptField'>
  <tr>
    <th>Key</th>
    <th>Status/Resolution</th>
    <th>FixVersion</th>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CDRIVER-4756'>CDRIVER-4756</a>
    </td>
    <td>Blocked</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CXX-2779'>CXX-2779</a>
    </td>
    <td>Blocked</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CSHARP-4829'>CSHARP-4829</a>
    </td>
    <td>Blocked</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/GODRIVER-3034'>GODRIVER-3034</a>
    </td>
    <td>Blocked</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/JAVA-5228'>JAVA-5228</a>
    </td>
    <td>Blocked</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/NODE-5722'>NODE-5722</a>
    </td>
    <td>Blocked</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/MOTOR-1204'>MOTOR-1204</a>
    </td>
    <td>Blocked</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PYTHON-4020'>PYTHON-4020</a>
    </td>
    <td>Blocked</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PHPLIB-1299'>PHPLIB-1299</a>
    </td>
    <td>Blocked</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/RUBY-3343'>RUBY-3343</a>
    </td>
    <td>Blocked</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/RUST-1790'>RUST-1790</a>
    </td>
    <td>Blocked</td>
    <td class=''></td>
  </tr>
</table>]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18362" key="com.atlassian.jira.plugin.system.customfieldtypes:userpicker">
                        <customfieldname>Engineering Lead</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>jeff.yemin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_21553" key="com.atlassian.jira.plugin.system.customfieldtypes:labels">
                        <customfieldname>Quarter</customfieldname>
                        <customfieldvalues>
                                        <label>FY25Q1</label>
    
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1vgrk:</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_14261" key="com.atlassian.jira.plugin.system.customfieldtypes:datepicker">
                        <customfieldname>Start date</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 2 Jan 2024 00:00:00 +0000</customfieldvalue>

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