Hey MongoDB Team.
I’m getting an issues on the production environment about the following:
System.InvalidOperationException: Thread static buffer is already in use. at MongoDB.Bson.IO.ThreadStaticBuffer.RentBuffer(Int32 size) at MongoDB.Bson.IO.EncodingHelper.GetBytesUsingThreadStaticBuffer(Encoding encoding, String value).
This exception came from different places:
MongoDB.Bson.IO.ByteBufferStream.WriteString(String value, UTF8Encoding encoding)
MongoDB.Bson.IO.BsonTrie1.Add(String elementName, TValue value) MongoDB.Bson.IO.BsonTrie
1.TryGetValue(String elementName, TValue& value)
Whenever my web app gets that exception then the thread can not process anymore until I restart my web app.
I have a look at the source
mongo-csharp-driver/src/MongoDB.Bson/IO/EncodingHelper.cs at master · mongodb/mongo-csharp-driver (github.com)
and look like the exception came from this
Could you give me some insight about what might be causing the issue?
I’m using MongoDB Driver 2.18 and my web app still had a lot of RAM when I got that issue.
Thanks in advance.