<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:40:14 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-1640] FirstOrDefaultAsync never return?</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1640</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;MongoDB.Driver 2.2.3&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;TestMethod&amp;#93;&lt;/span&gt;&lt;br/&gt;
        public async Task  GetAsync()&lt;/p&gt;
        {
            SocialRobotRepository repo = new SocialRobotRepository();

            SocialRobotEntity doc = await repo.GetAsync(x =&amp;gt; x.RobotId == 11438);
        }


&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;CollectionNameAttribute(&amp;quot;Ymt_Social_Robot&amp;quot;)&amp;#93;&lt;/span&gt;&lt;br/&gt;
    public class SocialRobotEntity : MongoEntityBase&lt;br/&gt;
    {&lt;br/&gt;
        public int RobotId &lt;/p&gt;
{ get; set; }&lt;br/&gt;
&lt;br/&gt;
        public int AdminId { get; set; }

&lt;p&gt;        public string AdminName &lt;/p&gt;
{ get; set; }&lt;br/&gt;
&lt;br/&gt;
        public int UserId { get; set; }

&lt;p&gt;        public DateTime CreatedAt &lt;/p&gt;
{ get; set; }&lt;br/&gt;
&lt;br/&gt;
        public string UserName { get; set; }

&lt;p&gt;        public string UserAvatar &lt;/p&gt;
{ get; set; }
&lt;p&gt;    }&lt;/p&gt;

&lt;p&gt; public class SocialRobotRepository:MongoRepository&amp;lt;SocialRobotEntity&amp;gt;&lt;br/&gt;
    {&lt;br/&gt;
    }&lt;/p&gt;

&lt;p&gt;  public class MongoRepository&amp;lt;T&amp;gt; : IMongoRepository&amp;lt;T&amp;gt; where T : MongoEntityBase&lt;br/&gt;
    {&lt;br/&gt;
   public async Task&amp;lt;T&amp;gt; GetAsync(Expression&amp;lt;Func&amp;lt;T, bool&amp;gt;&amp;gt; filter)&lt;/p&gt;
        {
            return await collection.Find(filter).FirstOrDefaultAsync();
        }

&lt;p&gt;}&lt;br/&gt;
=============================&lt;br/&gt;
Test Name:	GetAsync&lt;br/&gt;
Test FullName:	Ymatou.Social.Core.Test.DataAccess.MongoRepositoryTest.GetAsync&lt;br/&gt;
Test Source:	e:\Work\doc\99 &#20010;&#20154;&#25991;&#20214;&#22841;\Ymatou.Social.Core\Ymatou.Social.Core.Test\DataAccess\MongoRepositoryTest.cs : line 26&lt;br/&gt;
Test Outcome:	Failed&lt;br/&gt;
Test Duration:	0:00:46.977356&lt;/p&gt;

&lt;p&gt;Result Message:	&lt;br/&gt;
Test method Ymatou.Social.Core.Test.DataAccess.MongoRepositoryTest.GetAsync threw exception: &lt;br/&gt;
System.TimeoutException: A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = ReadPreferenceServerSelector{ ReadPreference = &lt;/p&gt;
{ Mode = SecondaryPreferred, TagSets = [] }
&lt;p&gt; }, LatencyLimitingServerSelector&lt;/p&gt;
{ AllowedLatencyRange = 00:00:00.0150000 }
&lt;p&gt; }. Client view of cluster state is { ClusterId : &quot;1&quot;, ConnectionMode : &quot;ReplicaSet&quot;, Type : &quot;ReplicaSet&quot;, State : &quot;Disconnected&quot;, Servers : [{ ServerId: &quot;&lt;/p&gt;
{ ClusterId : 1, EndPoint : &quot;Unspecified/set3a.mongodb.ymatou.com:27017&quot; }
&lt;p&gt;&quot;, EndPoint: &quot;Unspecified/set3a.mongodb.ymatou.com:27017&quot;, State: &quot;Disconnected&quot;, Type: &quot;Unknown&quot; }, { ServerId: &quot;&lt;/p&gt;
{ ClusterId : 1, EndPoint : &quot;Unspecified/set3b.mongodb.ymatou.com:27017&quot; }
&lt;p&gt;&quot;, EndPoint: &quot;Unspecified/set3b.mongodb.ymatou.com:27017&quot;, State: &quot;Disconnected&quot;, Type: &quot;Unknown&quot; }] }.&lt;br/&gt;
Result StackTrace:	&lt;br/&gt;
&#22312; MongoDB.Driver.Core.Clusters.Cluster.ThrowTimeoutException(IServerSelector selector, ClusterDescription description)&lt;br/&gt;
   &#22312; MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChangedHelper.HandleCompletedTask(Task completedTask)&lt;br/&gt;
   &#22312; MongoDB.Driver.Core.Clusters.Cluster.&amp;lt;WaitForDescriptionChangedAsync&amp;gt;d__44.MoveNext()&lt;br/&gt;
&amp;#8212; &#24341;&#21457;&#24322;&#24120;&#30340;&#19978;&#19968;&#20301;&#32622;&#20013;&#22534;&#26632;&#36319;&#36394;&#30340;&#26411;&#23614; &amp;#8212;&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()&lt;br/&gt;
   &#22312; MongoDB.Driver.Core.Clusters.Cluster.&amp;lt;SelectServerAsync&amp;gt;d__37.MoveNext()&lt;br/&gt;
&amp;#8212; &#24341;&#21457;&#24322;&#24120;&#30340;&#19978;&#19968;&#20301;&#32622;&#20013;&#22534;&#26632;&#36319;&#36394;&#30340;&#26411;&#23614; &amp;#8212;&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()&lt;br/&gt;
   &#22312; MongoDB.Driver.Core.Bindings.ReadPreferenceBinding.&amp;lt;GetReadChannelSourceAsync&amp;gt;d__8.MoveNext()&lt;br/&gt;
&amp;#8212; &#24341;&#21457;&#24322;&#24120;&#30340;&#19978;&#19968;&#20301;&#32622;&#20013;&#22534;&#26632;&#36319;&#36394;&#30340;&#26411;&#23614; &amp;#8212;&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()&lt;br/&gt;
   &#22312; MongoDB.Driver.Core.Operations.FindOperation`1.&amp;lt;ExecuteAsync&amp;gt;d__107.MoveNext()&lt;br/&gt;
&amp;#8212; &#24341;&#21457;&#24322;&#24120;&#30340;&#19978;&#19968;&#20301;&#32622;&#20013;&#22534;&#26632;&#36319;&#36394;&#30340;&#26411;&#23614; &amp;#8212;&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()&lt;br/&gt;
   &#22312; MongoDB.Driver.OperationExecutor.&amp;lt;ExecuteReadOperationAsync&amp;gt;d__1`1.MoveNext()&lt;br/&gt;
&amp;#8212; &#24341;&#21457;&#24322;&#24120;&#30340;&#19978;&#19968;&#20301;&#32622;&#20013;&#22534;&#26632;&#36319;&#36394;&#30340;&#26411;&#23614; &amp;#8212;&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()&lt;br/&gt;
   &#22312; MongoDB.Driver.MongoCollectionImpl`1.&amp;lt;ExecuteReadOperationAsync&amp;gt;d__59`1.MoveNext()&lt;br/&gt;
&amp;#8212; &#24341;&#21457;&#24322;&#24120;&#30340;&#19978;&#19968;&#20301;&#32622;&#20013;&#22534;&#26632;&#36319;&#36394;&#30340;&#26411;&#23614; &amp;#8212;&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()&lt;br/&gt;
   &#22312; MongoDB.Driver.IAsyncCursorSourceExtensions.&amp;lt;FirstOrDefaultAsync&amp;gt;d__5`1.MoveNext()&lt;br/&gt;
&amp;#8212; &#24341;&#21457;&#24322;&#24120;&#30340;&#19978;&#19968;&#20301;&#32622;&#20013;&#22534;&#26632;&#36319;&#36394;&#30340;&#26411;&#23614; &amp;#8212;&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()&lt;br/&gt;
   &#22312; Ymatou.Social.Core.DataAccess.MongoRepository`1.&amp;lt;GetAsync&amp;gt;d__0.MoveNext() &#20301;&#32622; e:\Work\doc\99 &#20010;&#20154;&#25991;&#20214;&#22841;\Ymatou.Social.Core\Ymatou.Social.Core\DataAccess\MongoRepository.cs:&#34892;&#21495; 32&lt;br/&gt;
&amp;#8212; &#24341;&#21457;&#24322;&#24120;&#30340;&#19978;&#19968;&#20301;&#32622;&#20013;&#22534;&#26632;&#36319;&#36394;&#30340;&#26411;&#23614; &amp;#8212;&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()&lt;br/&gt;
   &#22312; Ymatou.Social.Core.Test.DataAccess.MongoRepositoryTest.&amp;lt;GetAsync&amp;gt;d__0.MoveNext() &#20301;&#32622; e:\Work\doc\99 &#20010;&#20154;&#25991;&#20214;&#22841;\Ymatou.Social.Core\Ymatou.Social.Core.Test\DataAccess\MongoRepositoryTest.cs:&#34892;&#21495; 29&lt;br/&gt;
&amp;#8212; &#24341;&#21457;&#24322;&#24120;&#30340;&#19978;&#19968;&#20301;&#32622;&#20013;&#22534;&#26632;&#36319;&#36394;&#30340;&#26411;&#23614; &amp;#8212;&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;br/&gt;
   &#22312; System.Runtime.CompilerServices.TaskAwaiter.GetResult()&lt;/p&gt;</description>
                <environment></environment>
        <key id="282668">CSHARP-1640</key>
            <summary>FirstOrDefaultAsync never return?</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="9">Done</resolution>
                                        <assignee username="craig.wilson@mongodb.com">Craig Wilson</assignee>
                                    <reporter username="arraylist">tianzhonghai</reporter>
                        <labels>
                            <label>question</label>
                    </labels>
                <created>Wed, 27 Apr 2016 01:56:45 +0000</created>
                <updated>Fri, 5 Apr 2019 13:58:17 +0000</updated>
                            <resolved>Thu, 18 Aug 2016 14:15:57 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="1247702" author="craiggwilson" created="Wed, 27 Apr 2016 12:31:45 +0000"  >&lt;p&gt;Hi tianzhonghai,&lt;/p&gt;

&lt;p&gt;The problem here isn&apos;t FirstOrDefaultAsync(). It&apos;s that it appears none of your servers are connected, as can be seen in the exception message. Are you having network issues? Is there anyway you could turn on &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;System.Net.Sockets tracing&lt;/a&gt; so we can see what is going on at the network level?&lt;/p&gt;

&lt;p&gt;Craig&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|hsku7r:</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>