<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:42:40 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-2477] MongoDb Driver hangs out for really long time when mongos going down</title>
                <link>https://jira.mongodb.org/browse/CSHARP-2477</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I have sharded cluster with auto-scale on scale sets in Azure. This error seems to happen, when my client writes to Mongo, cluster has 3 mongos, 2 replica-sets. Client writes with high possible throughput using many threads and connections.&lt;br/&gt;
Additional settings:&lt;/p&gt;

&lt;p&gt;settings.MaxConnectionPoolSize = 2000;&lt;br/&gt;
settings.WaitQueueSize = 10000;&lt;/p&gt;


&lt;p&gt;Then one mongos is going down (because scale set decide to shut it down).&lt;br/&gt;
First i gets errors of this kind:&lt;/p&gt;

&lt;p&gt;&quot;&lt;span class=&quot;error&quot;&gt;&amp;#91;2019-01-10 17:18:56.130 GMT 28 Error 0 Lingaro.OpenIoT.Orleans.Grains.DeviceGrain&amp;#93;&lt;/span&gt; !!!!!!!!!! Error during grain execution! Setting previous state&lt;br/&gt;
Exc level 0: MongoDB.Driver.MongoWriteException: A write operation resulted in an error.&lt;br/&gt;
&#160; Write results unavailable from mongo-s1-2:27017 due to interrupted at shutdown&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.MongoCollectionBase`1.ReplaceOneAsync(FilterDefinition`1 filter, TDocument replacement, UpdateOptions options, Func`3 bulkWriteAsync)&lt;br/&gt;
&#160; &#160;at Lingaro.OpenIoT.Orleans.Grains.DeviceGrain.WriteStateAsync() in C:\src\iotplatformdev\orleans\Lingaro.OpenIoT\Lingaro.OpenIoT.Orleans.Grains\Grains\DeviceGrain.cs:line 108&lt;br/&gt;
&#160; &#160;at Lingaro.OpenIoT.Orleans.Grains.DeviceGrain.&amp;lt;Process&amp;gt;b__5_0() in C:\src\iotplatformdev\orleans\Lingaro.OpenIoT\Lingaro.OpenIoT.Orleans.Grains\Grains\DeviceGrain.cs:line 92&lt;br/&gt;
&#160; &#160;at Lingaro.OpenIoT.Orleans.Grains.DeviceGrain.WrapInTimeout&lt;span class=&quot;error&quot;&gt;&amp;#91;T&amp;#93;&lt;/span&gt;(String actionName, TimeSpan timeout, Func`1 action) in C:\src\iotplatformdev\orleans\Lingaro.OpenIoT\Lingaro.OpenIoT.Orleans.Grains\Grains\DeviceGrain.cs:line 141&lt;br/&gt;
&#160; &#160;at Lingaro.OpenIoT.Orleans.Grains.DeviceGrain.Process(EventHubMessage eventHubMessage) in C:\src\iotplatformdev\orleans\Lingaro.OpenIoT\Lingaro.OpenIoT.Orleans.Grains\Grains\DeviceGrain.cs:line 90&lt;br/&gt;
Exc level 1: MongoDB.Driver.MongoBulkWriteException`1&lt;span class=&quot;error&quot;&gt;&amp;#91;MongoDB.Bson.BsonDocument&amp;#93;&lt;/span&gt;: A bulk write operation resulted in one or more errors.&lt;br/&gt;
&#160; Write results unavailable from mongo-s1-2:27017 due to interrupted at shutdown&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.MongoCollectionImpl`1.BulkWriteAsync(IClientSessionHandle session, IEnumerable`1 requests, BulkWriteOptions options, CancellationToken cancellationToken)&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.MongoCollectionImpl`1.UsingImplicitSessionAsync&lt;span class=&quot;error&quot;&gt;&amp;#91;TResult&amp;#93;&lt;/span&gt;(Func`2 funcAsync, CancellationToken cancellationToken)&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.MongoCollectionBase`1.ReplaceOneAsync(FilterDefinition`1 filter, TDocument replacement, UpdateOptions options, Func`3 bulkWriteAsync)&quot;&lt;/p&gt;

&lt;p&gt;And it seems reasonable as one mongos is shutting down.&lt;br/&gt;
But then after working a while, whole process hang out. After a really long time i gets something like this:&lt;/p&gt;

&lt;p&gt;&quot;&lt;span class=&quot;error&quot;&gt;&amp;#91;2019-01-10 17:35:06.509 GMT 28Error0Lingaro.OpenIoT.Orleans.Grains.DeviceGrain&amp;#93;&lt;/span&gt;!!!!!!!!!! Operation WriteStateAsync took long time to complete! Took 954750.3796 ms.&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;2019-01-10 17:35:06.508 GMT 27Error0Lingaro.OpenIoT.Orleans.Grains.DeviceGrain&amp;#93;&lt;/span&gt;!!!!!!!!!! Error during grain execution! Setting previous state&lt;br/&gt;
Exc level 0: MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server.&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelperAsync(CancellationToken cancellationToken)&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.Core.Servers.Server.GetChannelAsync(CancellationToken cancellationToken)&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.Core.Operations.RetryableWriteContext.InitializeAsync(CancellationToken cancellationToken)&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.Core.Operations.RetryableWriteContext.CreateAsync(IWriteBinding binding, Boolean retryRequested, CancellationToken cancellationToken)&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.Core.Operations.BulkMixedWriteOperation.ExecuteAsync(IWriteBinding binding, CancellationToken cancellationToken)&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.OperationExecutor.ExecuteWriteOperationAsync&lt;span class=&quot;error&quot;&gt;&amp;#91;TResult&amp;#93;&lt;/span&gt;(IWriteBinding binding, IWriteOperation`1 operation, CancellationToken cancellationToken)&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.MongoCollectionImpl`1.ExecuteWriteOperationAsync&lt;span class=&quot;error&quot;&gt;&amp;#91;TResult&amp;#93;&lt;/span&gt;(IClientSessionHandle session, IWriteOperation`1 operation, CancellationToken cancellationToken)&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.MongoCollectionImpl`1.BulkWriteAsync(IClientSessionHandle session, IEnumerable`1 requests, BulkWriteOptions options, CancellationToken cancellationToken)&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.MongoCollectionImpl`1.UsingImplicitSessionAsync&lt;span class=&quot;error&quot;&gt;&amp;#91;TResult&amp;#93;&lt;/span&gt;(Func`2 funcAsync, CancellationToken cancellationToken)&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.MongoCollectionBase`1.ReplaceOneAsync(FilterDefinition`1 filter, TDocument replacement, UpdateOptions options, Func`3 bulkWriteAsync)&lt;br/&gt;
&#160; &#160;at Lingaro.OpenIoT.Orleans.Grains.DeviceGrain.WriteStateAsync() in C:\src\iotplatformdev\orleans\Lingaro.OpenIoT\Lingaro.OpenIoT.Orleans.Grains\Grains\DeviceGrain.cs:line 108&lt;br/&gt;
&#160; &#160;at Lingaro.OpenIoT.Orleans.Grains.DeviceGrain.&amp;lt;Process&amp;gt;b__5_0() in C:\src\iotplatformdev\orleans\Lingaro.OpenIoT\Lingaro.OpenIoT.Orleans.Grains\Grains\DeviceGrain.cs:line 92&lt;br/&gt;
&#160; &#160;at Lingaro.OpenIoT.Orleans.Grains.DeviceGrain.WrapInTimeout&lt;span class=&quot;error&quot;&gt;&amp;#91;T&amp;#93;&lt;/span&gt;(String actionName, TimeSpan timeout, Func`1 action) in C:\src\iotplatformdev\orleans\Lingaro.OpenIoT\Lingaro.OpenIoT.Orleans.Grains\Grains\DeviceGrain.cs:line 141&lt;br/&gt;
&#160; &#160;at Lingaro.OpenIoT.Orleans.Grains.DeviceGrain.Process(EventHubMessage eventHubMessage) in C:\src\iotplatformdev\orleans\Lingaro.OpenIoT\Lingaro.OpenIoT.Orleans.Grains\Grains\DeviceGrain.cs:line 90&lt;br/&gt;
Exc level 1: MongoDB.Driver.MongoConnectionException: An exception occurred while receiving a message from the server.&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBufferAsync()&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBufferAsync(Int32 responseTo, CancellationToken cancellationToken)&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveMessageAsync(Int32 responseTo, IMessageEncoderSelector encoderSelector, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken)&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol`1.ExecuteAsync(IConnection connection, CancellationToken cancellationToken)&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.Core.Connections.IsMasterHelper.GetResultAsync(IConnection connection, CommandWireProtocol`1 isMasterProtocol, CancellationToken cancellationToken)&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.Core.Connections.ConnectionInitializer.InitializeConnectionAsync(IConnection connection, CancellationToken cancellationToken)&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelperAsync(CancellationToken cancellationToken)&lt;br/&gt;
Exc level 2: System.IO.IOException: Unable to read data from the transport connection: Connection timed out.&lt;br/&gt;
&#160; &#160;at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error)&lt;br/&gt;
&#160; &#160;at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)&lt;br/&gt;
&#160; &#160;at System.Threading.Tasks.ValueTask`1.ValueTaskSourceAsTask.&amp;lt;&amp;gt;c.&amp;lt;.cctor&amp;gt;b__4_0(Object state)&lt;br/&gt;
&amp;#8212; End of stack trace from previous location where exception was thrown &amp;#8212;&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.Core.Misc.StreamExtensionMethods.ReadBytesAsync(Stream stream, Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)&lt;br/&gt;
&#160; &#160;at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBufferAsync()&lt;br/&gt;
Exc level 3: System.Net.Sockets.SocketException: Connection timed out&quot;&lt;/p&gt;

&lt;p&gt;This indicate that Writing to mongoDB timeout after 954750.3796 ms!!!&lt;/p&gt;

&lt;p&gt;And i can correlate this with more mongos going down.&lt;br/&gt;
After that long timeout occurred - processing start happen again and writing to mongoDB going with success.&lt;br/&gt;
Sometimes this situation can happen twice or more. (Hanging for really long time).&#160;&lt;/p&gt;</description>
                <environment>Ubuntu Server 18.04 LTS VM on Azure&lt;br/&gt;
</environment>
        <key id="670072">CSHARP-2477</key>
            <summary>MongoDb Driver hangs out for really long time when mongos going down</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="9">Done</resolution>
                                        <assignee username="wan.bachtiar@mongodb.com">Wan Bachtiar</assignee>
                                    <reporter username="darthkurak">Jakub Dropia</reporter>
                        <labels>
                            <label>wb</label>
                    </labels>
                <created>Fri, 11 Jan 2019 08:46:30 +0000</created>
                <updated>Thu, 25 Jun 2020 02:28:07 +0000</updated>
                            <resolved>Thu, 25 Jun 2020 02:28:07 +0000</resolved>
                                    <version>2.7.2</version>
                                                    <component>Command Operations</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3223179" author="rachelle.palmer" created="Thu, 25 Jun 2020 02:28:07 +0000"  >&lt;p&gt;Hi there, thank you for reaching out to MongoDB. As this sounds more like a support issue, I wanted to give you some resources to get this question answered more quickly:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;our MongoDB support portal, located at &lt;a href=&quot;https://support.mongodb.com/welcome&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;support.mongodb.com&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;our MongoDB community forums, located &lt;a href=&quot;https://developer.mongodb.com/community/forums/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;If you are an Atlas customer, there is free support offered 24/7 in the lower right hand corner of the UI.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Thank you!&lt;br/&gt;
Rachelle&lt;/p&gt;</comment>
                            <comment id="3040072" author="vikscool97@gmail.com" created="Wed, 15 Apr 2020 04:00:41 +0000"  >&lt;p&gt;Is there any update on this issue?&lt;br/&gt;
It was raised in Jan 2019 and it still persists in April 2020. So, is someone really looking into it or not?&lt;/p&gt;</comment>
                            <comment id="2166802" author="kurakmen@gmail.com" created="Thu, 28 Feb 2019 22:22:57 +0000"  >&lt;p&gt;Hi! Any progress on this?&#160;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                    <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000nmxscQAA]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <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|hu8x6v:</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>