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

Queries using the Legacy API can leak connections resulting in TimeoutExceptions

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Blocker - P1 Blocker - P1
    • 2.2.2
    • Affects Version/s: 2.2
    • Component/s: Connectivity

      After upgrading from 2.0 to 2.2, I started getting System.TimeoutExceptions a few minutes after starting my app. The timeouts are occurring after 0ms, which seems like it's a problem.

      System.TimeoutException: Timed out waiting for a connection after 0ms.
      at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool.AcquireConnectionHelper.EnteredPool(Boolean enteredPool)
      at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool.AcquireConnection(CancellationToken cancellationToken)
      at MongoDB.Driver.Core.Servers.ClusterableServer.GetChannel(CancellationToken cancellationToken)
      at MongoDB.Driver.Core.Operations.FindOperation`1.Execute(IReadBinding binding, CancellationToken cancellationToken)
      at MongoDB.Driver.MongoCursor`1.GetEnumerator()

      2016-01-14:

      The bug is that queries using the Legacy API can fail to return a connection to the connection pool. The bug is triggered when the result set is large enough that the results are returned in multiple batches. Each time such a query is made one connection is failed to be returned to the connection pool, and once all the connections in the pool have been leaked no further queries can be made (with the symptom being that a TimeoutException is thrown from AcquireConnection).

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            borigas@nebraskaglobal.com Ben Origas
            Votes:
            5 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: