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

Make ThreadStaticBuffer resilient to OutOfMemoryException

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • 2.18.0
    • Affects Version/s: 2.15.0
    • Component/s: Serialization
    • None

      Summary

      See https://github.com/mongodb/mongo-csharp-driver/pull/777

      It should be quite obvious to understand that when an Exception happens on one of the lines after the __isBufferRented flag is set the flag will never be reset, and ALL FUTURE CALLS in the same Thread will throw  "Thread static buffer is already in use."

      One example is an OutOfMemoryException on one of the lines with an allocation.

      We actually have seen this in a 32bit application.

            Assignee:
            boris.dogadov@mongodb.com Boris Dogadov
            Reporter:
            matthi.d@googlemail.com Matthias Dittrich
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: