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

Count operation ignored CancellationToken

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.3
    • Component/s: API
    • Labels:
      None
    • Environment:
      Server - Ununtu 16.x
      Client - Windows Server 2012

      I run long Count operation (sync version), that use 10 sec query (in this case its normal).
      We can't use async version for some reasons.

      ...
      
      cancellationTokenSource.CancelAfter(1000);
      
      GetCollection<SomeModel>("SomeModel").Count(filter, cancellationTokenSource.Token)
      

      But Сount whatever takes 10 seconds. Why it is not cancelling ?
      Or it check it only before start ?
      I know about MaxTime, but we need to set time limit for many operations and this bug cause use us bad design code.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            zoxexivo@gmail.com Ivan Artemov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: