0

We are using the latest beta driver from MongoDB (2.0.0-beta2) with all the async capabilities. But compared to the old implementation (1.10.0-rc0) we are getting some weird TimeoutExceptions. We have tried different server versions (among others, also 3.0.0-rc10), but that doesnot seem to influence this.

System.TimeoutException occurred
  HResult=-2146233083
  Message=Operation timed out after 00:00:30.
  Source=MongoDB.Driver
  StackTrace:
       at MongoDB.Driver.OperationExecutor.<ExecuteReadOperationAsync>d__0`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
       at MongoDB.Driver.MongoCollectionImpl`1.<ExecuteReadOperation>d__5e`1.MoveNext()

We have a hard time reproducing this, firing a couple of thousands inserts, updates and finds does not trigger this bug. However, running our .NET web application does trigger this (after creating a couple of new entities).

The Exception location differs but one of the places is in our FindAll method. Our code does:

IMongoCollection<BsonDocument> col = _database.GetCollection<BsonDocument>(GetCollectionName(qmoType));
IFindFluent<BsonDocument, BsonDocument> findFluent = col.Find(MongoDBWhereBuilder.BuildWhere(where));

findFluent = findFluent.Sort(SortBy.Ascending(sort.Keys.ToArray());
findFluent = findFluent.Skip(skip);
findFluent = findFluent.Limit(take);

List<BsonDocument> list = await findFluent.ToListAsync();

The _database variable is shared between all requests (it is created once at startup).

How can we get a better grip on this problem? Or are there others that have this issue?

2
  • I've filed a ticket here: jira.mongodb.org/browse/CSHARP-1184. Probabably a better place to work through a bug than on StackOverflow. As mentioned in the ticket, you can increase the operation timeout value in MongoClientSettings. In addition, this setting didn't exist in the 1.x driver, so it could be that you are just seeing it now. Regardless, something taking longer than 30 seconds is extremely problematic. Thank you so much for testing. Commented Feb 25, 2015 at 17:33
  • @CraigWilson Thanks. I'm not sure if it is a bug or an error on our side. But I follow the ticket and add additional comments there. Commented Feb 26, 2015 at 7:07

2 Answers 2

1

This is a bug in the beta2 driver. The fix is merged into master (and part of beta3): https://jira.mongodb.org/browse/CSHARP-1184

Sign up to request clarification or add additional context in comments.

Comments

0

I think that might still be present in versions 2.0.1/2.1.0. We had to downgrade to 1.10.0 which was the previous version we had and that made the number of connections going back to under 100 and the response times to less that 100ms (from 500-600 sometimes).

Maybe there is something in the legacy wrapper around the async code that is causing that delay.

2 Comments

Did you file this bug with the mongodb team? We aren't seeing any regressions.
I haven't raise that with them yet but I will do it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.