<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:43:03 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-2621] Connection reset by peer</title>
                <link>https://jira.mongodb.org/browse/CSHARP-2621</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I am getting a &quot;Connection reset by peer&quot; message periodically throughout the day.&#160; I have microservices running .net core 2.1 and .net core 2.2 and both are throwing this exception.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;The exception is thrown when doing simple Find queries.&#160; I don&apos;t have any custom timeout settings applied on MongoClient to setup the connection.&#160; I have the connection setup as a singleton to allow MongoClient to grab a connection from the connection pool it manages.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Looking at .net core 2.1 issues, there is a reported defect on this as they have optimized their connection code.&#160; I am wondering if the two are related.&lt;/p&gt;

&lt;p&gt;See Sockets Performance and SocketsHttpHandler&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://devblogs.microsoft.com/dotnet/announcing-net-core-2-1-preview-2/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://devblogs.microsoft.com/dotnet/announcing-net-core-2-1-preview-2/&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Github Defect&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/dotnet/corefx/issues/32305&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/dotnet/corefx/issues/32305&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;I have tried setting&#160;DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER environment variable as noted in the above links, but that does not resolve the issue.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Here is the exception details:&lt;/p&gt;

&lt;p&gt;MongoDB.Driver.MongoConnectionException: An exception occurred while receiving a message from the server. ---&amp;gt; System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer. ---&amp;gt; System.Net.Sockets.SocketException: Connection reset by peer&lt;/p&gt;

&lt;p&gt;at MongoDB.Driver.IAsyncCursorSourceExtensions.ToListAsync&lt;span class=&quot;error&quot;&gt;&amp;#91;TDocument&amp;#93;&lt;/span&gt;(IAsyncCursorSource`1 source, CancellationToken cancellationToken)&lt;br/&gt;
at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBufferAsync(Int32 responseTo, CancellationToken cancellationToken)&lt;br/&gt;
at MongoDB.Driver.Core.Misc.StreamExtensionMethods.ReadBytesAsync(Stream stream, Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)&lt;br/&gt;
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;
at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBufferAsync()&lt;/p&gt;</description>
                <environment></environment>
        <key id="779050">CSHARP-2621</key>
            <summary>Connection reset by peer</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="riaz.ahmad">Riaz Ahmad</reporter>
                        <labels>
                    </labels>
                <created>Tue, 28 May 2019 23:31:54 +0000</created>
                <updated>Thu, 25 Jun 2020 02:28:05 +0000</updated>
                            <resolved>Thu, 25 Jun 2020 02:28:05 +0000</resolved>
                                    <version>2.8.1</version>
                                                    <component>Connectivity</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="3223176" author="rachelle.palmer" created="Thu, 25 Jun 2020 02:28:05 +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="2339264" author="riaz.ahmad" created="Tue, 23 Jul 2019 16:54:11 +0000"  >&lt;p&gt;This issue looks to be related to&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-2648&quot; title=&quot;Connection Reset By Peer - with driver 2.8.0 and mongo 4.0.9 on a k8s cluster&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-2648&quot;&gt;&lt;del&gt;CSHARP-2648&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2265501" author="riaz.ahmad" created="Thu, 30 May 2019 16:37:28 +0000"  >&lt;p&gt;Environment - Ubuntu Bionic 18.04 &amp;amp; Ubuntu Trusty 14.04&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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|huqmf3:</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>