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

Deadlock possible between BsonDefaultSerializer and BsonClassMap when classes are AutoMapped on the fly

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.1
    • Affects Version/s: 1.0
    • Component/s: None
    • Labels:
      None

      In a heavily multithreaded environment it is possible to get a deadlock between threads when classes are AutoMapped on the fly as needed.

      Sample program to reproduce attached. Must add a 1 second sleep to BsonDefaultSerializer.LookupActualType right after the lock on staticLock is acquired to have high probability of encountering the deadlock (the deadlock can occur without the sleep but with such low probability that it would be harder to reproduce).

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

              Created:
              Updated:
              Resolved: