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

Creating files with Upload() in Parallel threads causes md5 and chunk errors.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Blocker - P1 Blocker - P1
    • 1.3
    • Affects Version/s: 1.2
    • Component/s: None
    • Environment:
      OS: Windows 7
      Framework: .NET 4.0 and Mono 2.10.x

      This unit tests fails with MongoDB.Driver.MongoCommandException : Command 'filemd5' failed: exception: chunks out of order (response:

      { "errmsg" : "exception: chunks out of order", "code" : 10040, "ok" : 0.0 }

      ).

      The server complains that:

      Fri Sep 16 11:50:28 [conn518] should have chunk: 1 have:0
      c->nextSafe():

      { _id: ObjectId('4e737044ef94a52e101deef8'), files_id: ObjectId(' 4e737044ef94a52e101deee4'), n: 0, data: BinData }

      c->nextSafe():

      { _id: ObjectId('4e737044ef94a52e101deef1'), files_id: ObjectId(' 4e737044ef94a52e101deee4'), n: 0, data: BinData }

      Fri Sep 16 11:50:29 [conn513] should have chunk: 1 have:0
      c->nextSafe():

      { _id: ObjectId('4e737044ef94a52e101deef4'), files_id: ObjectId(' 4e737044ef94a52e101deee1'), n: 0, data: BinData }

      c->nextSafe():

      { _id: ObjectId('4e737044ef94a52e101deeed'), files_id: ObjectId(' 4e737044ef94a52e101deee1'), n: 0, data: BinData }

      Fri Sep 16 11:50:29 [conn509] should have chunk: 1 have:0
      c->nextSafe():

      { _id: ObjectId('4e737044ef94a52e101def05'), files_id: ObjectId(' 4e737044ef94a52e101deefb'), n: 0, data: BinData }

      c->nextSafe():

      { _id: ObjectId('4e737044ef94a52e101def00'), files_id: ObjectId(' 4e737044ef94a52e101deefb'), n: 0, data: BinData }

      NOTE: I I changed MaxConnectionPoolSize in MongoDbServerSettings to 1, meaning only a single connection can be alive at once, this error does not occur.

      I'd also like to point out that using ThreadPool in the C# Connection Manager seems like a bad idea seeing as this ThreadPool is static and shared with everything else in the system allowing any code in the system to essentially "lock out" the WaitCallback's.

        1. Program.cs
          3 kB
        2. GridTest.cs
          3 kB
        3. GridTest.cs
          3 kB

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            afinnell Andrew Finnell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: