<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:38:00 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-2181] Use dedicated state constants for the connection, pool, poolGenerationMap, Server, and Topology types</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-2181</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;Currently, &lt;tt&gt;connection&lt;/tt&gt;, &lt;tt&gt;pool&lt;/tt&gt;, &lt;tt&gt;Server&lt;/tt&gt;, and &lt;tt&gt;Topology&lt;/tt&gt; all use the same set of &quot;connected state&quot; constants (defined in &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/2fa2b7c7575618b6e47a7f9e78df3e8a831b540a/x/mongo/driver/topology/server.go#L57-L64&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;server.go&lt;/a&gt;). However, their state transitions are confusingly different, leading to misunderstanding about how to check connected state of those different types (and bugs).&lt;/p&gt;

&lt;p&gt;For example, all of those types use the &lt;tt&gt;connected&lt;/tt&gt; and &lt;tt&gt;disconnected&lt;/tt&gt; states, but not all use &lt;tt&gt;connecting&lt;/tt&gt;, &lt;tt&gt;disconnecting&lt;/tt&gt;, and &lt;tt&gt;initialized&lt;/tt&gt;. There&apos;s also a bug in &lt;tt&gt;Topology.Connect()&lt;/tt&gt; that prevents a &lt;tt&gt;Topology&lt;/tt&gt; from ever connecting if the &lt;tt&gt;Connect()&lt;/tt&gt; function encounters an error while connecting the topology. The &lt;tt&gt;Topology&lt;/tt&gt; gets stuck in the &lt;tt&gt;connecting&lt;/tt&gt; state, which causes all subsequent calls to &lt;tt&gt;Connect()&lt;/tt&gt; to return &lt;tt&gt;ErrTopologyConnected&lt;/tt&gt;. There&apos;s a similar bug in &lt;tt&gt;Server.Disconnect()&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;&lt;del&gt;Create a &quot;connected state&quot; state machine that uses the same state transitions for all types that need to maintain and expose connection state.&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;&lt;del&gt;Definition of done:&lt;/del&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;del&gt;The &lt;tt&gt;connection&lt;/tt&gt;, &lt;tt&gt;pool&lt;/tt&gt;, &lt;tt&gt;Server&lt;/tt&gt;, and &lt;tt&gt;Topology&lt;/tt&gt; types all use the same state transitions:&lt;/del&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;del&gt;&lt;tt&gt;disconnected&lt;/tt&gt; --&amp;gt; &lt;tt&gt;connecting&lt;/tt&gt;&lt;/del&gt;&lt;/li&gt;
		&lt;li&gt;&lt;del&gt;&lt;tt&gt;connecting&lt;/tt&gt; --&amp;gt; &lt;tt&gt;connected&lt;/tt&gt;&lt;/del&gt;&lt;/li&gt;
		&lt;li&gt;&lt;del&gt;&lt;tt&gt;connecting&lt;/tt&gt; --&amp;gt; &lt;tt&gt;disconnected&lt;/tt&gt;&lt;/del&gt;&lt;/li&gt;
		&lt;li&gt;&lt;del&gt;&lt;tt&gt;connected&lt;/tt&gt; --&amp;gt; &lt;tt&gt;disconnecting&lt;/tt&gt;&lt;/del&gt;&lt;/li&gt;
		&lt;li&gt;&lt;del&gt;&lt;tt&gt;disconnecting&lt;/tt&gt; --&amp;gt; &lt;tt&gt;disconnected&lt;/tt&gt;&lt;/del&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;del&gt;The &lt;tt&gt;connection&lt;/tt&gt;, &lt;tt&gt;pool&lt;/tt&gt;, &lt;tt&gt;Server&lt;/tt&gt;, and &lt;tt&gt;Topology&lt;/tt&gt; types all expose their &quot;connected state&quot; through identical APIs (instead of directly via atomically-accessed ints).&lt;/del&gt;&lt;/li&gt;
	&lt;li&gt;&lt;del&gt;Resolve bugs in &lt;tt&gt;Topology.Connect()&lt;/tt&gt; and &lt;tt&gt;Server.Disconnect()&lt;/tt&gt; that cause instances of those types to get stuck in the &lt;tt&gt;connecting&lt;/tt&gt; and &lt;tt&gt;disconnecting&lt;/tt&gt; state, respectively.&lt;/del&gt;&lt;/li&gt;
	&lt;li&gt;&lt;del&gt;Remove the now-unused &lt;tt&gt;initialized&lt;/tt&gt; state.&lt;/del&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The best first step here is to use a different set of constants for each type&apos;s &quot;state&quot; value.&lt;/p&gt;

&lt;p&gt;New definition of done:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Use dedicated constants for each of the  &lt;tt&gt;connection&lt;/tt&gt;, &lt;tt&gt;pool&lt;/tt&gt;, &lt;tt&gt;poolGenerationMap&lt;/tt&gt; &lt;tt&gt;Server&lt;/tt&gt;, and &lt;tt&gt;Topology&lt;/tt&gt; types.&lt;/li&gt;
	&lt;li&gt;Remove any unused states for each type.&lt;/li&gt;
	&lt;li&gt;Rename the &quot;state&quot; field in each of the above types to &lt;tt&gt;state&lt;/tt&gt;.&lt;br/&gt;
&#160;&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="1895374">GODRIVER-2181</key>
            <summary>Use dedicated state constants for the connection, pool, poolGenerationMap, Server, and Topology types</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="9">Done</resolution>
                                        <assignee username="matt.dale@mongodb.com">Matt Dale</assignee>
                                    <reporter username="matt.dale@mongodb.com">Matt Dale</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Oct 2021 19:18:11 +0000</created>
                <updated>Tue, 3 May 2022 14:12:44 +0000</updated>
                            <resolved>Wed, 16 Mar 2022 21:39:44 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="4417021" author="xgen-internal-githook" created="Wed, 16 Mar 2022 21:39:34 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Matt Dale&apos;, &apos;email&apos;: &apos;9760375+matthewdale@users.noreply.github.com&apos;, &apos;username&apos;: &apos;matthewdale&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-2181&quot; title=&quot;Use dedicated state constants for the connection, pool, poolGenerationMap, Server, and Topology types&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-2181&quot;&gt;&lt;del&gt;GODRIVER-2181&lt;/del&gt;&lt;/a&gt; Use different state constants for each topology type. (#870)&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/001e5500b894c10ff04a6d92e1f500e31d2cf982&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/commit/001e5500b894c10ff04a6d92e1f500e31d2cf982&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4402600" author="JIRAUSER1259527" created="Thu, 10 Mar 2022 01:49:18 +0000"  >&lt;p&gt;PR: &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/pull/870&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/pull/870&lt;/a&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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>GODRIVER-1799</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_21553" key="com.atlassian.jira.plugin.system.customfieldtypes:labels">
                        <customfieldname>Quarter</customfieldname>
                        <customfieldvalues>
                                        <label>FY22Q4</label>
    
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i018qf:2</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>