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

Deadlock in Web Context

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.2, 2.2.3
    • Component/s: GridFS
    • Environment:
      ASP.Net WebApi

      There appears to be a deadlock when trying to find files in GridFS using the Async method.

      var client = new MongoClient("whatever_connection_str");
      var database = client.GetDatabase("your_db");
      var bucket = new GridFSBucket(database, new GridFSBucketOptions

      { BucketName = "MyDocs" }

      );
      var builder = Builders<GridFSFileInfo>.Filter;

      // userid is embedded in the metadata of the fileinfo, confirmed it's there and correct type etc
      var filter = builder.Eq(info => info.Metadata["UserId"], <any_object_id>);
      var files = await bucket.FindAsync(filter); <-- this deadlocks in ASP.Net

      If you try the same code in a console app it works fine.

            Assignee:
            Unassigned Unassigned
            Reporter:
            steve.ward.uk@gmail.com Steven Ward
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: