Make ThreadStaticBuffer resilient to OutOfMemoryException

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Unknown
    • 2.18.0
    • Affects Version/s: 2.15.0
    • Component/s: Serialization
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
              Reporter:
              Matthias Dittrich
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: