I use nuget MongoDB.Driver Version=2.17.1
.
Sometimes find operation is freezed while making request to mongo database. And this freeze can last upto 2 hours or more.
Here how I call find:
Set<EntityDto>().Find(x => x.Id == id).FirstOrDefaultAsync(cancellationToken);
I tried to find any options to set timeout and found:
- class
MongoClientSettings
with many properies likeConnectTimeout
,MaxConnectionIdleTime
,MaxConnectionLifeTime
,ServerSelectionTimeout
,SocketTimeout
- class
FindOptions
with propertiesMaxAwaitTime
,MaxTime
.
But I can’t find any documentations what each property serve to. And can’t find any default values equals to 2 hours.
Also I found here the solution with cancelationToken.
But anyway I’d like to find out with all these settings in mongo library.
Anyone knows where to find explanation or documentation?