<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:33:54 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-285] Client should have a Close method</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-285</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;The Client type should have a Close method so that users can shutdown the associated connections to a MongoDB deployment.&lt;/p&gt;

&lt;p&gt;When this method returns, all sockets to the database from the Client instance must be closed.&lt;/p&gt;</description>
                <environment></environment>
        <key id="513516">GODRIVER-285</key>
            <summary>Client should have a Close method</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="9">Done</resolution>
                                        <assignee username="kris.brandow@mongodb.com">Kristofer Brandow</assignee>
                                    <reporter username="kris.brandow@mongodb.com">Kristofer Brandow</reporter>
                        <labels>
                            <label>Stitch</label>
                    </labels>
                <created>Mon, 19 Mar 2018 18:30:43 +0000</created>
                <updated>Thu, 19 Apr 2018 16:09:59 +0000</updated>
                            <resolved>Thu, 19 Apr 2018 01:20:52 +0000</resolved>
                                    <version>0.0.2</version>
                                    <fixVersion>0.0.3</fixVersion>
                                    <component>CRUD</component>
                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="1868382" author="xgen-internal-githook" created="Thu, 19 Apr 2018 01:20:30 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;kris@mongodb.com&apos;, &apos;username&apos;: &apos;skriptble&apos;, &apos;name&apos;: &apos;Kris Brandow&apos;}
&lt;p&gt;Message: Add Connect and Disconnect functionality&lt;/p&gt;

&lt;p&gt;&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;/p&gt;

&lt;p&gt;Change-Id: I1d2eae1cc94a93c0664665541b12682131a49018&lt;br/&gt;
Branch: master&lt;br/&gt;
&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;https://github.com/mongodb/mongo-go-driver/commit/94ae2dc59114fbf6dd39707929068adfa20a92e8&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1868345" author="kris.brandow" created="Wed, 18 Apr 2018 23:56:45 +0000"  >&lt;p&gt;Code Review: &lt;a href=&quot;https://review.gerrithub.io/c/408109/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.gerrithub.io/c/408109/&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="1855630" author="kris.brandow" created="Wed, 4 Apr 2018 20:57:00 +0000"  >&lt;p&gt;I spoke with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=eric.daniels&quot; class=&quot;user-hover&quot; rel=&quot;eric.daniels&quot;&gt;eric.daniels&lt;/a&gt; and a few other people and here are my thoughts on how to move forward.&lt;/p&gt;

&lt;p&gt;The main requirement is that after a Client has been &quot;closed&quot; there should be no more network traffic to the servers associated with that Client. This adds a couple of requirements to the implementation:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;The close method should take a context, so that it can timeout or be canceled if there is a long running command that a user would like to kill via another method.&lt;/li&gt;
	&lt;li&gt;The close method should take a maxWait parameter. If this parameter is a positive duration, the close method will aggressively close all of the connections associated with the Client, including those that may have inflight read or write requests.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Together these two requirements allow for the use cases of close-and-wait, close-or-timeout, and close-or-aggressively-disconnect. Given that an io.Closer does not take a context nor a maxWait parameter and that in Go one should avoid naming methods that are interface methods if they have a different signature, we should call this close method Disconnect.&lt;/p&gt;

&lt;p&gt;Additionally, to avoid memory churn in applications that create a large number of clients, calling Disconnect shouldn&apos;t irreversibly close either the Client nor the Topology. We should add another method, Connect, that will start monitoring goroutines and initialize the Client and Topology. The Topology type already has an initialization method that can be renamed to Connect, however Client currently auto connects. This goes against the principle of &quot;constructors shouldn&apos;t have side effects&quot;.&lt;/p&gt;

&lt;p&gt;We can either 1) Not change NewClient and add a new function NewUnconnectedClient that returns a client without calling Connect or 2) Change NewClient to not call Connect and add a new function NewConnectedClient that calls Connect.&lt;/p&gt;

&lt;p&gt;Additionally, we might want to eventually explore being able to reset a Server so that we can reuse and pool those types as well.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="513515">GODRIVER-284</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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>GODRIVER-271</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr9mpz:</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>