Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1180

The wait queue for acquiring a connection to server is full

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.0
    • Component/s: Performance
    • Labels:
      None
    • Environment:
      Win 8.1 x64, MongoDB 2.6.7

      I wanted to try the new 2.0 async features and used the C# Driver Tutorial with the following snippet:

      Parallel.For(0, 100000, async _ =>
      {
      var e = new Entity

      { Name = "Tom" }

      ;
      await collection.InsertOneAsync(e);
      });

      But after a short period my program fails:

      Unhandled Exception:
      Unhandled Exception:
      Unhandled Exception: MongoDB.Driver.MongoWaitQueueFullException: The wait queue
      for acquiring a connection to server localhost:27017 is full.
      at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool.<AcquireConnec
      tionAsync>d__0.MoveNext()
      — End of stack trace from previous location where exception was thrown —

      When I change the connectionstring to: "mongodb://localhost?maxpoolsize=20000 it seems to work, but hogs alot of memory (> 1GB Ram).

      Btw. 1.1.0 works totally fine.

            Assignee:
            Unassigned Unassigned
            Reporter:
            camak Casoa Makaso
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: