<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:43:08 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-2648] Connection Reset By Peer - with driver 2.8.0 and mongo 4.0.9 on a k8s cluster</title>
                <link>https://jira.mongodb.org/browse/CSHARP-2648</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;We have been getting &quot;Connection Reset by Peer&quot; mongo errors in our setup. A description of the setup:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;mongo running as a replicaset in a k8s cluster on EKS&lt;/li&gt;
	&lt;li&gt;clients (C#) running in the same k8s cluster on EKS&lt;/li&gt;
	&lt;li&gt;mongo 4.0.9&lt;/li&gt;
	&lt;li&gt;C# driver 2.8.0&lt;/li&gt;
	&lt;li&gt;Connection pooling ON&lt;/li&gt;
	&lt;li&gt;max idle time not set (defaults to 10s)&lt;/li&gt;
	&lt;li&gt;max connection lifetime not set (defaults to 10s)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;We get these errors. We observed that if there is a series of calls, say 500 calls to do a key based select, there is no issue. Then we pause for 5 minutes, and repeat the test, the first time we get a &quot;Connection Reset by Peer&quot;. Later, the test continues. This happens every time after pause.&lt;/p&gt;

&lt;p&gt;This condition repeats with real users behavior, there may be spurts of activity and then a lull. As a consequence we keep getting &quot;Connection reset by peer&quot; at critical parts in the business workflow. On the client side, the solution is to perform defensive coding and repeat the call, but that&apos;s a change in many places.&lt;/p&gt;

&lt;p&gt;Other combinations attempted:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;mongo 4.0.9&lt;/li&gt;
	&lt;li&gt;C# driver 2.8.0&lt;/li&gt;
	&lt;li&gt;Connection pooling ON&lt;/li&gt;
	&lt;li&gt;max idle time 120s&lt;/li&gt;
	&lt;li&gt;max connection lifetime 60s&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;However no change in the behavior.&lt;/p&gt;

&lt;p&gt;It appears to us that while the TCP connection is closed on the server side, the client still thinks that it&apos;s a valid connection and attempts to use it, leading to this error.&lt;/p&gt;

&lt;p&gt;Has anybody else faced such a situation? Any suggestions would be appreciated, happy to provide more information if needed.&lt;/p&gt;</description>
                <environment>AWS EKS, Ubuntu base images and Ubuntu host for clients, Mongo 4.0.9 docker image (replica set) hosted on AWS EKS - same cluster as the clients.</environment>
        <key id="811455">CSHARP-2648</key>
            <summary>Connection Reset By Peer - with driver 2.8.0 and mongo 4.0.9 on a k8s cluster</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="-1">Unassigned</assignee>
                                    <reporter username="alok.kumar@lendfoundry.com">Alok Kumar</reporter>
                        <labels>
                    </labels>
                <created>Mon, 24 Jun 2019 09:33:10 +0000</created>
                <updated>Mon, 20 Jul 2020 16:30:07 +0000</updated>
                            <resolved>Mon, 20 Jul 2020 16:30:07 +0000</resolved>
                                    <version>2.8.0</version>
                                                    <component>Connectivity</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="3292717" author="jeff.yemin" created="Mon, 20 Jul 2020 16:29:58 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=alok.kumar%40lendfoundry.com&quot; class=&quot;user-hover&quot; rel=&quot;alok.kumar@lendfoundry.com&quot;&gt;alok.kumar@lendfoundry.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sorry for losing track of this.  Do you have a full stack trace available?  I&apos;m surprised this would happen after a pause given that idle connections in the pool should have been pruned in that 5 minute interval.&lt;/p&gt;

&lt;p&gt;Also, as this sounds more like a support issue, I wanted to give you some other 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;/ul&gt;


&lt;p&gt;I&apos;m going to close this now, but happy to re-open if you have more information.&lt;/p&gt;</comment>
                            <comment id="2339267" author="riaz.ahmad" created="Tue, 23 Jul 2019 16:55:16 +0000"  >&lt;p&gt;This issue looks to be related to&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-2621&quot; title=&quot;Connection reset by peer&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-2621&quot;&gt;&lt;del&gt;CSHARP-2621&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2296108" author="alok.kumar@lendfoundry.com" created="Tue, 25 Jun 2019 05:12:20 +0000"  >&lt;p&gt;I need to make a correction to this issue report.&lt;/p&gt;

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

&lt;p&gt;Initial settings were&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;max idle time set 10 minutes&lt;/li&gt;
	&lt;li&gt;max connection lifetime 10 minutes&lt;/li&gt;
&lt;/ul&gt;


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

&lt;p&gt;We used to get connection reset by peer errors but not many. However they existed.&lt;/p&gt;

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

&lt;p&gt;Subsequent settings were&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;max idle time set to 120 minutes&lt;/li&gt;
	&lt;li&gt;max connection lifetime set to 60 minutes&lt;/li&gt;
&lt;/ul&gt;


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

&lt;p&gt;After this change, the connection reset by peer errors have increased.&lt;/p&gt;

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

&lt;p&gt;Now, we have changed these settings to the following values;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;max idle time set to 60secs&lt;/li&gt;
	&lt;li&gt;max connection lifetime set to 60 secs&lt;/li&gt;
&lt;/ul&gt;


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

&lt;p&gt;The errors have now dropped significantly.&lt;/p&gt;

&lt;p&gt;With larger connection lifetimes, the error count is higher.&lt;/p&gt;

&lt;p&gt;I could not find a way to edit the original issue, if someone can edit that for me it would be appreciated.&lt;/p&gt;

&lt;p&gt;&#160;&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|huvrnr:</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>