<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:38:26 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-1014] Failing to connect to a replica set under load </title>
                <link>https://jira.mongodb.org/browse/CSHARP-1014</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;under some load (~100 concurrent threads), the driver throws the following exception: &lt;/p&gt;

&lt;p&gt;  &quot;MESSAGE: Unable to connect to a member of the replica set matching the read preference Primary&lt;br/&gt;
STACKTRACE:    at MongoDB.Driver.Internal.MultipleInstanceMongoServerProxy.ThrowConnectionException(ReadPreference readPreference)&lt;br/&gt;
   at MongoDB.Driver.Internal.MultipleInstanceMongoServerProxy.Connect(TimeSpan timeout, ReadPreference readPreference)&lt;br/&gt;
   at MongoDB.Driver.Internal.MultipleInstanceMongoServerProxy.ChooseServerInstance(ReadPreference readPreference)&lt;br/&gt;
   at MongoDB.Driver.MongoServer.AcquireConnection(MongoDatabase database, ReadPreference readPreference)&lt;br/&gt;
   at MongoDB.Driver.MongoCursorEnumerator`1.AcquireConnection()&lt;br/&gt;
   at MongoDB.Driver.MongoCursorEnumerator`1.GetFirst()&lt;br/&gt;
   at MongoDB.Driver.MongoCursorEnumerator`1.MoveNext()&lt;br/&gt;
   at System.Linq.Enumerable.FirstOrDefault&lt;span class=&quot;error&quot;&gt;&amp;#91;TSource&amp;#93;&lt;/span&gt;(IEnumerable`1 source)&lt;br/&gt;
   at MongoDB.Driver.MongoCollection.FindOneAs&lt;span class=&quot;error&quot;&gt;&amp;#91;TDocument&amp;#93;&lt;/span&gt;(IMongoQuery query)&lt;br/&gt;
   at MongoDB.Driver.MongoCollection`1.FindOne(IMongoQuery query)&lt;/p&gt;


&lt;p&gt;if we remove the replica set from the connection, the problem goes away. &lt;/p&gt;

&lt;p&gt;I saw another issue mentioning this problem where removing &quot;disconnect&quot; solves the issue.  we don&apos;t use disconnect. &lt;/p&gt;

&lt;p&gt;this is a blocking issue &lt;/p&gt;</description>
                <environment>Windows 2012</environment>
        <key id="145893">CSHARP-1014</key>
            <summary>Failing to connect to a replica set under load </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="-1">Unassigned</assignee>
                                    <reporter username="MikiMullor">Miki Mullor [X]</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Jul 2014 02:04:03 +0000</created>
                <updated>Sat, 4 Apr 2015 22:49:29 +0000</updated>
                            <resolved>Sat, 4 Apr 2015 22:49:29 +0000</resolved>
                                    <version>1.9.1</version>
                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="651592" author="miki@jobaline.com" created="Tue, 8 Jul 2014 14:00:44 +0000"  >&lt;p&gt;Instead of connecting to the replica set, we changed the connection&lt;br/&gt;
string to connect only to the primary node (removing read preferences&lt;br/&gt;
, only having one host asa target).    Doing so works around the&lt;br/&gt;
issue.&lt;/p&gt;


</comment>
                            <comment id="651541" author="craiggwilson" created="Tue, 8 Jul 2014 13:10:34 +0000"  >&lt;p&gt;Could you explain what &quot;if we remove the replica set from the connection, the problem goes away&quot; means? I&apos;m not sure what you are referring to.&lt;/p&gt;</comment>
                            <comment id="651192" author="mikimullor" created="Tue, 8 Jul 2014 03:21:20 +0000"  >&lt;p&gt;It seems that when we attempt to acquire a connection there is a point in time where when Choosing the server instance to connect ( which should be a secondary as our read Preferences mode state) the list of connected instances retrieved from connectedInstance.GetSecondaries() have an invalid state.&lt;/p&gt;

&lt;p&gt;they appear as disconnected and non of them is mark as IsSecondary.&lt;/p&gt;
</comment>
                    </comments>
                    <attachments>
                            <attachment id="47180" name="image-1.png" size="97205" author="MikiMullor" created="Tue, 8 Jul 2014 03:23:43 +0000"/>
                            <attachment id="47179" name="image.png" size="97205" author="MikiMullor" created="Tue, 8 Jul 2014 03:23:43 +0000"/>
                    </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|hs0tgf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>129220</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>