<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:40:51 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>[CSHARP-1855] Upgrading from Mongo Legacy 1.11.0 to 2.4.0 (or 2.3.0) connection Timeout Issues</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1855</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;After upgrading from 1.11.0 to 2.4.0 or 2.3.0 C# legacy driver, we have connection issues being reported at random. The main modified code was dealing with how to connect to mongo. We changed it from:&lt;/p&gt;

&lt;p&gt;db = new MongoClient(url).GetServer().GetDatabase(url.DatabaseName, settings);&lt;/p&gt;

&lt;p&gt;to this:&lt;/p&gt;

&lt;p&gt;db = new MongoServer(serverSettings).GetDatabase(url.DatabaseName, settings);&lt;/p&gt;

&lt;p&gt;Any advice would be appreciated.&lt;/p&gt;

&lt;p&gt;{&quot;Type&quot;:&quot;System.TimeoutException&quot;,&quot;Message&quot;:&quot;A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = WritableServerSelector, LatencyLimitingServerSelector&lt;/p&gt;
{ AllowedLatencyRange = 00:00:00.0150000 }
&lt;p&gt; }. Client view of cluster state is { ClusterId : \&quot;2\&quot;, ConnectionMode : \&quot;ReplicaSet\&quot;, Type : \&quot;ReplicaSet\&quot;, State : \&quot;Disconnected\&quot;, Servers : [{ ServerId: \&quot;&lt;/p&gt;
{ ClusterId : 2, EndPoint : \&quot;Unspecified/aga-rogue-mongo01.aga-dev.sandbox.farm:27017\&quot; }
&lt;p&gt;\&quot;, EndPoint: \&quot;Unspecified/aga-rogue-mongo01.aga-dev.sandbox.farm:27017\&quot;, State: \&quot;Disconnected\&quot;, Type: \&quot;Unknown\&quot; }, { ServerId: \&quot;&lt;/p&gt;
{ ClusterId : 2, EndPoint : \&quot;Unspecified/aga-rogue-mongo02.aga-dev.sandbox.farm:27017\&quot; }
&lt;p&gt;\&quot;, EndPoint: \&quot;Unspecified/aga-rogue-mongo02.aga-dev.sandbox.farm:27017\&quot;, State: \&quot;Disconnected\&quot;, Type: \&quot;Unknown\&quot; }] }.&quot;,&quot;Source&quot;:&quot;MongoDB.Driver.Core&quot;,&quot;Data&quot;:{},&quot;StackTrace&quot;:&quot;   at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChangedHelper.HandleCompletedTask(Task completedTask)\r\n   at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChanged(IServerSelector selector, ClusterDescription description, Task descriptionChangedTask, TimeSpan timeout, CancellationToken cancellationToken)\r\n   at MongoDB.Driver.Core.Clusters.Cluster.SelectServer(IServerSelector selector, CancellationToken cancellationToken)\r\n   at MongoDB.Driver.Core.Bindings.WritableServerBinding.GetReadChannelSource(CancellationToken cancellationToken)\r\n   at MongoDB.Driver.Core.Operations.FindOperation`1.Execute(IReadBinding binding, CancellationToken cancellationToken)&lt;/p&gt;</description>
                <environment>Mongo Server Version 3.2.9&lt;br/&gt;
Mongo C# Driver Version 2.3.0 and 2.4.0</environment>
        <key id="335599">CSHARP-1855</key>
            <summary>Upgrading from Mongo Legacy 1.11.0 to 2.4.0 (or 2.3.0) connection Timeout Issues</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="5">Cannot Reproduce</resolution>
                                        <assignee username="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="kuhnboy">Ryan Kuhn</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Dec 2016 19:39:29 +0000</created>
                <updated>Fri, 12 Jan 2018 15:22:33 +0000</updated>
                            <resolved>Fri, 12 Jan 2018 15:22:33 +0000</resolved>
                                    <version>2.3</version>
                                                    <component>Connectivity</component>
                                        <votes>1</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="1772762" author="rstam" created="Fri, 12 Jan 2018 15:22:13 +0000"  >&lt;p&gt;Linking to &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-2147&quot; title=&quot;Add logging of heartbeat information and SDAM state transitions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-2147&quot;&gt;&lt;del&gt;CSHARP-2147&lt;/del&gt;&lt;/a&gt; as additional logging would have helped troubleshoot the potential issue.&lt;/p&gt;</comment>
                            <comment id="1555115" author="kuhnboy" created="Fri, 21 Apr 2017 19:13:37 +0000"  >&lt;p&gt;I solved my problem. There seems to be an issue with multiple database specific connection strings to the same servers. Example:&lt;/p&gt;

&lt;p&gt;mongodb://db1User:******@server_names/db1&lt;br/&gt;
mongodb://db2User:******@server_names/db2&lt;br/&gt;
mongodb://db3User:******@server_names/db3&lt;/p&gt;

&lt;p&gt;etc, as we have 25 different connection strings and users.&lt;/p&gt;

&lt;p&gt;By switching to one connection string:&lt;/p&gt;

&lt;p&gt;mongodb://masterUser:******@server_names&lt;/p&gt;

&lt;p&gt;And getting the database by name after we have the server connection via server.GetDatabase(&quot;db1&quot;).&lt;/p&gt;

&lt;p&gt;The problem is now solved. Please fix this behavior as I wouldn&apos;t expect it to start failing connections for having &amp;gt; 1 connection string.&lt;/p&gt;

</comment>
                            <comment id="1553180" author="kuhnboy" created="Wed, 19 Apr 2017 22:15:03 +0000"  >&lt;p&gt;Time of Log Message:&lt;br/&gt;
Date=2017-04-19 20:10:51,377, Exception={&quot;Type&quot;:&quot;System.TimeoutException&quot;,&quot;Message&quot;:&quot;A timeout occured after 30000ms.......&lt;/p&gt;

&lt;p&gt;Looked at both servers in the replica set:&lt;/p&gt;

&lt;p&gt;aga-rogue-mongo01.aga-dev.sandbox.farm:&lt;/p&gt;

&lt;p&gt;2017-04-19T20:10:46.054+0000 I NETWORK  &lt;span class=&quot;error&quot;&gt;&amp;#91;conn209085&amp;#93;&lt;/span&gt; end connection 10.108.97.81:65527 (87 connections now open)&lt;br/&gt;
2017-04-19T20:10:46.177+0000 I NETWORK  &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; connection accepted from 10.108.97.81:49161 #209086 (88 connections now open)&lt;br/&gt;
2017-04-19T20:10:46.177+0000 I NETWORK  &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; connection accepted from 10.108.97.81:49162 #209087 (89 connections now open)&lt;br/&gt;
2017-04-19T20:10:46.252+0000 I ACCESS   &lt;span class=&quot;error&quot;&gt;&amp;#91;conn209087&amp;#93;&lt;/span&gt; Successfully authenticated as principal asdbUser on AssetStatusDB&lt;/p&gt;

&lt;p&gt;aga-rogue-mongo02.aga-dev.sandbox.farm:&lt;/p&gt;

&lt;p&gt;2017-04-19T20:10:46.057+0000 I NETWORK  &lt;span class=&quot;error&quot;&gt;&amp;#91;conn108470&amp;#93;&lt;/span&gt; end connection 10.108.97.81:65528 (69 connections now open)&lt;br/&gt;
2017-04-19T20:10:46.105+0000 I NETWORK  &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; connection accepted from 10.108.97.81:49158 #108471 (70 connections now open)&lt;br/&gt;
2017-04-19T20:10:46.105+0000 I NETWORK  &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; connection accepted from 10.108.97.81:65534 #108472 (71 connections now open)&lt;br/&gt;
2017-04-19T20:10:46.163+0000 I ACCESS   &lt;span class=&quot;error&quot;&gt;&amp;#91;conn108471&amp;#93;&lt;/span&gt; Successfully authenticated as principal asdbUser on AssetStatusDB&lt;/p&gt;

&lt;p&gt;Connection String: &lt;br/&gt;
mongodb://asdbUser:********************@aga-rogue-mongo01.aga-dev.sandbox.farm:27017,aga-rogue-mongo02.aga-dev.sandbox.farm:27017/AssetStatusDB?replicaSet=rogue&lt;/p&gt;</comment>
                            <comment id="1553139" author="kuhnboy" created="Wed, 19 Apr 2017 21:29:23 +0000"  >&lt;p&gt;@rstam, same issue, made no difference:&lt;/p&gt;

&lt;p&gt;Exception={&quot;Type&quot;:&quot;System.TimeoutException&quot;,&quot;Message&quot;:&quot;A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = WritableServerSelector, LatencyLimitingServerSelector&lt;/p&gt;
{ AllowedLatencyRange = 00:00:00.0150000 }
&lt;p&gt; }. Client view of cluster state is { ClusterId : \&quot;3\&quot;, ConnectionMode : \&quot;ReplicaSet\&quot;, Type : \&quot;ReplicaSet\&quot;, State : \&quot;Disconnected\&quot;, Servers : [{ ServerId: \&quot;&lt;/p&gt;
{ ClusterId : 3, EndPoint : \&quot;Unspecified/aga-rogue-mongo01.aga-dev.sandbox.farm:27017\&quot; }
&lt;p&gt;\&quot;, EndPoint: \&quot;Unspecified/aga-rogue-mongo01.aga-dev.sandbox.farm:27017\&quot;, State: \&quot;Disconnected\&quot;, Type: \&quot;Unknown\&quot; }, { ServerId: \&quot;&lt;/p&gt;
{ ClusterId : 3, EndPoint : \&quot;Unspecified/aga-rogue-mongo02.aga-dev.sandbox.farm:27017\&quot; }
&lt;p&gt;\&quot;, EndPoint: \&quot;Unspecified/aga-rogue-mongo02.aga-dev.sandbox.farm:27017\&quot;, State: \&quot;Disconnected\&quot;, Type: \&quot;Unknown\&quot; }] }.&quot;,&quot;Source&quot;:&quot;MongoDB.Driver.Core&quot;,&quot;Data&quot;:{},&quot;StackTrace&quot;:&quot;   at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChangedHelper.HandleCompletedTask(Task completedTask)\r\n   at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChanged(IServerSelector selector, ClusterDescription description, Task descriptionChangedTask, TimeSpan timeout, CancellationToken cancellationToken)\r\n   at MongoDB.Driver.Core.Clusters.Cluster.SelectServer(IServerSelector selector, CancellationToken cancellationToken)\r\n   at MongoDB.Driver.Core.Bindings.WritableServerBinding.GetReadChannelSource(CancellationToken cancellationToken)\r\n   at MongoDB.Driver.Core.Operations.FindOperation`1.Execute(IReadBinding binding, CancellationToken cancellationToken)\r\n   at MongoDB.Driver.MongoCollection.ExecuteReadOperation&lt;span class=&quot;error&quot;&gt;&amp;#91;TResult&amp;#93;&lt;/span&gt;(IReadOperation`1 operation, ReadPreference readPreference)\r\n   at MongoDB.Driver.MongoCollection.FindOneAs&lt;span class=&quot;error&quot;&gt;&amp;#91;TDocument&amp;#93;&lt;/span&gt;(FindOneArgs args)\r\n&lt;/p&gt;</comment>
                            <comment id="1529711" author="rstam" created="Tue, 21 Mar 2017 19:24:47 +0000"  >&lt;p&gt;Not sure why you would be having connection timeout issues, but we recommend that you NOT use code like this:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;new MongoServer(...)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;When created this way the MongoServer instance can never be garbage collected, and you will eventually run out of memory (or ports).  Running out of ports might explain your connection issues.&lt;/p&gt;

&lt;p&gt;The correct way to get a MongoServer instance is:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var client = new MongoClient(...);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var server = client.GetServer();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="1455108" author="johan.widen" created="Mon, 12 Dec 2016 14:04:29 +0000"  >&lt;p&gt;We have the same problem as described but have not upgraded from legacy. &lt;br/&gt;
Mongo C# Driver Version: 2.3.0&lt;br/&gt;
Mongo Server Version: 3.2.10. &lt;br/&gt;
We create a connection with: var client = new MongoClient(connectionString);&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="481662">CSHARP-2147</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrax73:</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>