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

Unobserved task exception when connection times out

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.2.4
    • Affects Version/s: 2.2.2
    • Component/s: Connectivity
    • None
    • Fully Compatible

      When server connection times out, an unobserved task exception is thrown, even when synchronous API is used (see stack trace below).
      We have a handler for such exceptions installed globally (from the days when such exceptions terminated current AppDomain), so we occasionally get these traced when servers get down. While they are mostly harmless, I believe these exceptions should be handled and (probably) muted.

      at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelper(CancellationToken cancellationToken)
      at MongoDB.Driver.Core.Connections.BinaryConnection.Open(CancellationToken cancellationToken)
      at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool.AcquiredConnection.Open(CancellationToken cancellationToken)
      at MongoDB.Driver.Core.Servers.ClusterableServer.GetChannel(CancellationToken cancellationToken)
      at MongoDB.Driver.Core.Bindings.ServerChannelSource.GetChannel(CancellationToken cancellationToken)
      at MongoDB.Driver.Core.Bindings.ChannelSourceHandle.GetChannel(CancellationToken cancellationToken)
      at MongoDB.Driver.Core.Operations.CountOperation.Execute(IReadBinding binding, CancellationToken cancellationToken)
      at MongoDB.Driver.OperationExecutor.ExecuteReadOperation[TResult](IReadBinding binding, IReadOperation`1 operation, CancellationToken cancellationToken)
      at MongoDB.Driver.MongoCollectionImpl`1.ExecuteReadOperation[TResult](IReadOperation`1 operation, ReadPreference readPreference, CancellationToken cancellationToken)
      at MongoDB.Driver.MongoCollectionImpl`1.ExecuteReadOperation[TResult](IReadOperation`1 operation, CancellationToken cancellationToken)
      at MongoDB.Driver.MongoCollectionImpl`1.Count(FilterDefinition`1 filter, CountOptions options, CancellationToken cancellationToken)

            Assignee:
            craig.wilson@mongodb.com Craig Wilson
            Reporter:
            onyxmaster Aristarkh Zagorodnikov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: