<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:39: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>[CSHARP-1538] Legacy Driver Connect() times out.</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1538</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;hi &lt;br/&gt;
we have upgraded to 2.2.2 and even though we see the improvement, we still have connection timeout issues. here is the stacktrace:&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;Unhandled Exception: System.TimeoutException: A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = ReadPreferenceServerSelector{ ReadPreference = { Mode = Primary, TagSets = [] } }, LatencyLimitingServerSelector { AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : &quot;1&quot;, ConnectionMode : &quot;Automatic&quot;, Type : &quot;Unknown&quot;, State : &quot;Disconnected&quot;, Servers : [{ ServerId: &quot;{ ClusterId : 1, EndPoint : &quot;Unspecified/host:port&quot; }&quot;, EndPoint: &quot;Unspecified/host/port&quot;, State: &quot;Disconnected&quot;, Type: &quot;Unknown&quot; }] }.&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;   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;at MongoDB.Driver.Core.Clusters.Cluster.ThrowTimeoutException(IServerSelector selector, ClusterDescription description)&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;   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;at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChangedHelper.HandleCompletedTask(Task completedTask)&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;   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;at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChanged(IServerSelector selector, ClusterDescription description, Task descriptionChangedTask, TimeSpan timeout, CancellationToken cancellationToken)&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;   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;at MongoDB.Driver.Core.Clusters.Cluster.SelectServer(IServerSelector selector, CancellationToken cancellationToken)&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;   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;at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout)&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;at MongoDB.Driver.MongoServer.Connect()&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;here is what we add to connection string connecttimeout=300000;maxpoolsize=800;waitQueueSize=2000;waitQueueTimeout=5m.&lt;/p&gt;</description>
                <environment></environment>
        <key id="259345">CSHARP-1538</key>
            <summary>Legacy Driver Connect() times out.</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="craig.wilson@mongodb.com">Craig Wilson</reporter>
                        <labels>
                            <label>question</label>
                    </labels>
                <created>Tue, 19 Jan 2016 15:47:51 +0000</created>
                <updated>Thu, 6 Apr 2023 18:10:08 +0000</updated>
                            <resolved>Thu, 11 Jan 2018 14:22:03 +0000</resolved>
                                                                    <component>Connectivity</component>
                                        <votes>1</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="1771346" author="rstam" created="Thu, 11 Jan 2018 14:21:34 +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="1229497" author="sallgeud" created="Thu, 7 Apr 2016 18:41:01 +0000"  >&lt;p&gt;There&apos;s a distinct possibility that it&apos;s an issue in SERVER itself. (3.2.4 in our case)&lt;/p&gt;

&lt;p&gt;I was able to make it happen about a dozen times yesterday, primarily in a VERY heavily threaded scenario. It was, however, entirely unpredictable in its occurrence... still happening once every million or so requests. I was monitoring every single bit of the server at the time it happened, and there were hundreds of other requests during that 5 second timeout window for one of the queries. The server was up and pushing 10-15mbps at the time, and very responsive. Ongoing connections around the same time are fine. We were not near any system limits, such as connection limits or system handles. If there are other possible stats that might be tracked around the time, we can get those.&lt;/p&gt;

&lt;p&gt;Unfortunately the scenario in which we recreated this is not one that we can do during regular business hours, and is one that takes about an hour to complete, sometimes without issue &apos;til near the end, and sometimes without any issues whatsoever.&lt;/p&gt;

&lt;p&gt;What&apos;s hard for us is that we&apos;re dumping the entire stack trace all the way down as far as we can find inner exceptions... and there isn&apos;t even a mention of anything in our code. It almost seems like an unused pool connection is timing out and improperly throwing to another thread.  It almost always happens within a Parallel.ForEach, likely because that&apos;s the easiest way to create the massive threading we use.&lt;/p&gt;</comment>
                            <comment id="1226864" author="craiggwilson" created="Tue, 5 Apr 2016 21:23:49 +0000"  >&lt;p&gt;Chad,&lt;/p&gt;

&lt;p&gt;I think the next step for you, and maybe others, is to turn on network tracing: &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/ty48b824(v=vs.110).aspx&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://msdn.microsoft.com/en-us/library/ty48b824(v=vs.110).aspx&lt;/a&gt;. Particularly System.Net and System.Net.Sockets. It will be interesting to see what is going on there when something fails. We don&apos;t cache anything and simply delegate down to the framework, so when there is an issue with a timeout, or a host refusal, it&apos;s almost always something down there, particularly when it works most of the time.&lt;/p&gt;

&lt;p&gt;Craig&lt;/p&gt;</comment>
                            <comment id="1226387" author="sallgeud" created="Tue, 5 Apr 2016 16:46:29 +0000"  >&lt;p&gt;This may be unrelated, but we&apos;re seeing something similar. It never happens in our web code, but occasionally happens in our back-end code, that we&apos;ll have a timeout. It&apos;s very rare, happening less than once every 100,000 queries, often less than 1 in a billion queries... but it happens.  Logs from the mongo machine itself show plenty of successful connections around and during the same time as this failure.&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;Timed out connecting to Unspecified/hostname:27017. Timeout was 00:00:05.&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;   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;at MongoDB.Driver.Core.Connections.TcpStreamFactory.&amp;lt;ConnectAsync&amp;gt;d__4.MoveNext()&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;   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;--- End of stack trace from previous location where exception was thrown ---&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;   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;at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&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;   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;at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&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;   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;at MongoDB.Driver.Core.Connections.TcpStreamFactory.&amp;lt;CreateStreamAsync&amp;gt;d__3.MoveNext()&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;   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;--- End of stack trace from previous location where exception was thrown ---&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;   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;at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&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;   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;at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&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;at MongoDB.Driver.Core.Connections.BinaryConnection.&amp;lt;OpenAsyncHelperAsync&amp;gt;d__44.MoveNext()&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="1221310" author="craig.kennedy@samtec.com" created="Thu, 31 Mar 2016 15:22:51 +0000"  >&lt;p&gt;I solved the issue, I think.  I&apos;m reposting here for your info or anyone else searching for the same issue.  &lt;/p&gt;

&lt;p&gt;The mongodb log files revealed that using my connection string, it was trying to connect to the admin database, but the user was not defined in the admin database, but in the operational database.  Changing the connection string to include the database worked properly.&lt;/p&gt;

&lt;p&gt;As for why it always worked the second time through, I&apos;m not sure.&lt;/p&gt;</comment>
                            <comment id="1221294" author="craig.kennedy@samtec.com" created="Thu, 31 Mar 2016 15:12:07 +0000"  >&lt;p&gt;I&apos;m also receiving this same error.  There is a retry mechanism built-in.  &lt;b&gt;The process fails the first time, but immediately retries and is successful.&lt;/b&gt;  Please tell me what else I can provide to help in solving the issue.&lt;/p&gt;

&lt;p&gt;Driver version: 2.2.3.3&lt;br/&gt;
Connection string: mongodb://&lt;/p&gt;
{0}:{1}@localhost{0}
&lt;p&gt;:&lt;/p&gt;
{1}
&lt;p&gt; are filled in at runtime with values from the config file.  &lt;/p&gt;

&lt;p&gt;Here is the full call stack of what I&apos;m seeing as the result:&lt;br/&gt;
System.TimeoutException: 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;1&quot;, ConnectionMode : &quot;Automatic&quot;, Type : &quot;Unknown&quot;, State : &quot;Disconnected&quot;, Servers : [{ ServerId: &quot;&lt;/p&gt;
{ ClusterId : 1, EndPoint : &quot;Unspecified/localhost:27017&quot; }
&lt;p&gt;&quot;, EndPoint: &quot;Unspecified/localhost:27017&quot;, State: &quot;Disconnected&quot;, Type: &quot;Unknown&quot;, HeartbeatException: &quot;MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---&amp;gt; MongoDB.Driver.MongoAuthenticationException: Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1. ---&amp;gt; MongoDB.Driver.MongoCommandException: Command saslStart failed: Authentication failed..&lt;br/&gt;
   at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1.ProcessReply(ConnectionId connectionId, ReplyMessage`1 reply)&lt;br/&gt;
   at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1.&amp;lt;ExecuteAsync&amp;gt;d__11.MoveNext()&lt;br/&gt;
&amp;#8212; End of stack trace from previous location where exception was thrown &amp;#8212;&lt;br/&gt;
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;br/&gt;
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;br/&gt;
   at MongoDB.Driver.Core.Authentication.SaslAuthenticator.&amp;lt;AuthenticateAsync&amp;gt;d__7.MoveNext()&lt;br/&gt;
   &amp;#8212; End of inner exception stack trace &amp;#8212;&lt;br/&gt;
   at MongoDB.Driver.Core.Authentication.SaslAuthenticator.&amp;lt;AuthenticateAsync&amp;gt;d__7.MoveNext()&lt;br/&gt;
&amp;#8212; End of stack trace from previous location where exception was thrown &amp;#8212;&lt;br/&gt;
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;br/&gt;
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;br/&gt;
   at MongoDB.Driver.Core.Authentication.AuthenticationHelper.&amp;lt;AuthenticateAsync&amp;gt;d__1.MoveNext()&lt;br/&gt;
&amp;#8212; End of stack trace from previous location where exception was thrown &amp;#8212;&lt;br/&gt;
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;br/&gt;
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;br/&gt;
   at MongoDB.Driver.Core.Connections.ConnectionInitializer.&amp;lt;InitializeConnectionAsync&amp;gt;d__1.MoveNext()&lt;br/&gt;
&amp;#8212; End of stack trace from previous location where exception was thrown &amp;#8212;&lt;br/&gt;
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;br/&gt;
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;br/&gt;
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()&lt;br/&gt;
   at MongoDB.Driver.Core.Connections.BinaryConnection.&amp;lt;OpenHelperAsync&amp;gt;d__47.MoveNext()&lt;br/&gt;
   &amp;#8212; End of inner exception stack trace &amp;#8212;&lt;br/&gt;
   at MongoDB.Driver.Core.Connections.BinaryConnection.&amp;lt;OpenHelperAsync&amp;gt;d__47.MoveNext()&lt;br/&gt;
&amp;#8212; End of stack trace from previous location where exception was thrown &amp;#8212;&lt;br/&gt;
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;br/&gt;
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;br/&gt;
   at MongoDB.Driver.Core.Servers.ClusterableServer.&amp;lt;HeartbeatAsync&amp;gt;d__42.MoveNext()&quot; }] }.&lt;br/&gt;
   at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChangedHelper.HandleCompletedTask(Task completedTask)&lt;br/&gt;
   at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChanged(IServerSelector selector, ClusterDescription description, Task descriptionChangedTask, TimeSpan timeout, CancellationToken cancellationToken)&lt;br/&gt;
   at MongoDB.Driver.Core.Clusters.Cluster.SelectServer(IServerSelector selector, CancellationToken cancellationToken)&lt;br/&gt;
   at MongoDB.Driver.Core.Bindings.WritableServerBinding.GetWriteChannelSource(CancellationToken cancellationToken)&lt;br/&gt;
   at MongoDB.Driver.Core.Operations.BulkMixedWriteOperation.Execute(IWriteBinding binding, CancellationToken cancellationToken)&lt;br/&gt;
   at MongoDB.Driver.MongoCollectionImpl`1.ExecuteWriteOperation&lt;span class=&quot;error&quot;&gt;&amp;#91;TResult&amp;#93;&lt;/span&gt;(IWriteOperation`1 operation, CancellationToken cancellationToken)&lt;br/&gt;
   at MongoDB.Driver.MongoCollectionImpl`1.BulkWrite(IEnumerable`1 requests, BulkWriteOptions options, CancellationToken cancellationToken)&lt;br/&gt;
   at MongoDB.Driver.MongoCollectionBase`1.UpdateOne(FilterDefinition`1 filter, UpdateDefinition`1 update, UpdateOptions options, CancellationToken cancellationToken)&lt;br/&gt;
   at Samtec.Marketing.TickerAggregator.ManufacturingOrderChangedHandler.UpdateMongo(DateTime date, Int32 mfgOrderId, Int32 facilityId, Int32 partsCompleted) in d:\3\479\src\ManufacturingOrderChangedHandler.cs:line 74&lt;br/&gt;
   at Samtec.Marketing.TickerAggregator.ManufacturingOrderChangedHandler.Handle(IManufacturingOrderChanged message) in d:\3\479\src\ManufacturingOrderChangedHandler.cs:line 61&lt;br/&gt;
   at NServiceBus.Unicast.MessageHandlerRegistry.Invoke(Object handler, Object message, Dictionary`2 dictionary) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\MessageHandlerRegistry.cs:line 124&lt;br/&gt;
   at NServiceBus.InvokeHandlersBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Behaviors\InvokeHandlersBehavior.cs:line 23&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.&amp;lt;&amp;gt;c_&lt;em&gt;DisplayClass4_0.&amp;lt;InvokeNext&amp;gt;b&lt;/em&gt;_0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95&lt;br/&gt;
   at NServiceBus.SetCurrentMessageBeingHandledBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Behaviors\SetCurrentMessageBeingHandledBehavior.cs:line 17&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.&amp;lt;&amp;gt;c_&lt;em&gt;DisplayClass4_0.&amp;lt;InvokeNext&amp;gt;b&lt;/em&gt;_0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95&lt;br/&gt;
   at NServiceBus.LoadHandlersBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Behaviors\LoadHandlersBehavior.cs:line 45&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.&amp;lt;&amp;gt;c_&lt;em&gt;DisplayClass4_0.&amp;lt;InvokeNext&amp;gt;b&lt;/em&gt;_0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95&lt;br/&gt;
   at NServiceBus.ApplyIncomingMessageMutatorsBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\MessageMutator\ApplyIncomingMessageMutatorsBehavior.cs:line 23&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.&amp;lt;&amp;gt;c_&lt;em&gt;DisplayClass4_0.&amp;lt;InvokeNext&amp;gt;b&lt;/em&gt;_0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95&lt;br/&gt;
   at NServiceBus.ExecuteLogicalMessagesBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Messages\ExecuteLogicalMessagesBehavior.cs:line 24&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.&amp;lt;&amp;gt;c_&lt;em&gt;DisplayClass4_0.&amp;lt;InvokeNext&amp;gt;b&lt;/em&gt;_0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95&lt;br/&gt;
   at NServiceBus.CallbackInvocationBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Behaviors\CallbackInvocationBehavior.cs:line 22&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.&amp;lt;&amp;gt;c_&lt;em&gt;DisplayClass4_0.&amp;lt;InvokeNext&amp;gt;b&lt;/em&gt;_0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95&lt;br/&gt;
   at NServiceBus.DeserializeLogicalMessagesBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Messages\DeserializeLogicalMessagesBehavior.cs:line 47&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.&amp;lt;&amp;gt;c_&lt;em&gt;DisplayClass4_0.&amp;lt;InvokeNext&amp;gt;b&lt;/em&gt;_0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.&amp;lt;&amp;gt;c_&lt;em&gt;DisplayClass4_0.&amp;lt;InvokeNext&amp;gt;b&lt;/em&gt;_0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95&lt;br/&gt;
   at NServiceBus.SubscriptionReceiverBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Subscriptions\MessageDrivenSubscriptions\SubscriptionReceiverBehavior.cs:line 32&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.&amp;lt;&amp;gt;c_&lt;em&gt;DisplayClass4_0.&amp;lt;InvokeNext&amp;gt;b&lt;/em&gt;_0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95&lt;br/&gt;
   at NServiceBus.UnitOfWorkBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\UnitOfWork\UnitOfWorkBehavior.cs:line 42&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.&amp;lt;&amp;gt;c_&lt;em&gt;DisplayClass4_0.&amp;lt;InvokeNext&amp;gt;b&lt;/em&gt;_0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95&lt;br/&gt;
   at NServiceBus.ChildContainerBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Behaviors\ChildContainerBehavior.cs:line 17&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.&amp;lt;&amp;gt;c_&lt;em&gt;DisplayClass4_0.&amp;lt;InvokeNext&amp;gt;b&lt;/em&gt;_0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95&lt;br/&gt;
   at NServiceBus.ProcessingStatisticsBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Monitoring\ProcessingStatisticsBehavior.cs:line 23&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.&amp;lt;&amp;gt;c_&lt;em&gt;DisplayClass4_0.&amp;lt;InvokeNext&amp;gt;b&lt;/em&gt;_0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95&lt;br/&gt;
   at NServiceBus.AuditBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Audit\AuditBehavior.cs:line 20&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107&lt;br/&gt;
   at NServiceBus.BehaviorChain`1.Invoke() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 61&lt;br/&gt;
   at NServiceBus.Pipeline.PipelineExecutor.Execute&lt;span class=&quot;error&quot;&gt;&amp;#91;T&amp;#93;&lt;/span&gt;(BehaviorChain`1 pipelineAction, T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\PipelineExecutor.cs:line 129&lt;br/&gt;
   at NServiceBus.Unicast.Transport.TransportReceiver.ProcessMessage(TransportMessage message) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Transport\TransportReceiver.cs:line 346&lt;br/&gt;
   at NServiceBus.Unicast.Transport.TransportReceiver.TryProcess(TransportMessage message) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Transport\TransportReceiver.cs:line 230&lt;br/&gt;
   at NServiceBus.Transports.Msmq.MsmqDequeueStrategy.Action() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Transports\Msmq\MsmqDequeueStrategy.cs:line 266&lt;/p&gt;</comment>
                            <comment id="1214350" author="craiggwilson" created="Thu, 24 Mar 2016 20:00:22 +0000"  >&lt;p&gt;Hi Moshe,&lt;/p&gt;

&lt;p&gt;Any further information here? Otherwise, I&apos;ll go ahead and close the ticket as Cannot Reproduce.&lt;/p&gt;

&lt;p&gt;Craig&lt;/p&gt;</comment>
                            <comment id="1147404" author="moshe@imonlinegroup.com" created="Tue, 19 Jan 2016 16:29:39 +0000"  >&lt;p&gt;our setup contains a lot of processes and most of them work, so it is not the issue of certain process rather of certain situation on the server. There are some process that have a very big data exchange and that when it happened both of the times it did. I mean it did not happen with these large processes but with others that wanted to start while big ones were running.&lt;br/&gt;
 I will try to hunt the next time it falls and get the inner exception.&lt;/p&gt;</comment>
                            <comment id="1147339" author="craiggwilson" created="Tue, 19 Jan 2016 15:56:31 +0000"  >&lt;p&gt;There is no reason that connect would only work some of the time unless there is some form of network issue involved. I&apos;m not saying this isn&apos;t happening, just that I can&apos;t explain it. &lt;/p&gt;

&lt;p&gt;This stack trace coupled with your answer indicates that when this exception occurs, your application can&apos;t talk to MongoDB at all because this code is only called at application startup, one time. More interesting is that this has nothing to do with load or queries. You simply can&apos;t connect to MongoDB. However, certain pieces of expected information are missing from the stack trace you provided, like the internal exception stemming from the server itself.&lt;/p&gt;

&lt;p&gt;I have tried to reproduce this and simply cannot make it fail. Is there a small application you could provide that demonstrates this problem?&lt;/p&gt;

&lt;p&gt;Craig&lt;/p&gt;</comment>
                            <comment id="1147333" author="craiggwilson" created="Tue, 19 Jan 2016 15:51:54 +0000"  >&lt;p&gt;Some comments moved from &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-1515&quot; title=&quot;Queries using the Legacy API can leak connections resulting in  TimeoutExceptions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-1515&quot;&gt;&lt;del&gt;CSHARP-1515&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Are you calling Connect a lot? Technically, you don&apos;t even need to call Connect. Even if you are, it only needs to be called once. The reason I&apos;m interested is because it makes me wonder about what the code looks like below this... Could you provide a snippet of code around this call and perhaps some context for it? For instance, do you get a new MongoServer and call Connect for every web request?&lt;/p&gt;&lt;/blockquote&gt;

&lt;blockquote&gt;&lt;p&gt;i call connect once per process same regarding MongoServer&lt;/p&gt;&lt;/blockquote&gt;



</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="481662">CSHARP-2147</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="244490">CSHARP-1515</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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrax5r:</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>