Frequently facing with the exception (Thread static buffer is already in use)

Hey MongoDB Team.

I’m having an issue on production environment about the following

An error occurred while deserializing the FlowNodeId property of class ContactInputVariable: Thread static buffer is already in use.
The environment usually had a lot of activity and heavy load
One of the potential causes could be hitting allowed max pool size, but was my opinion/understanding and nothing more (I could be wrong).

Class Model

    public class ContactInputVariable
    {
        [BsonId]
        [BsonRepresentation(BsonType.ObjectId)]
        public string Id { get; set; }
        public string ContactId { get; set; }
        public string InputText { get; set; }
        public string VariableName { get; set; }
        public string FlowId { get; set; }
        public string FlowNodeId { get; set; }
        public DateTime Created { get; set; }
    }

Project is using Official .NET driver for MongoDB v. 2.15.1

Have no idea why is this happening.
Could you give me some insight about what might be causing the issue.

Thanks in advance.

1 Like

Hi, just faced with the same issue, did you find any solution? @Rudik_Manucharyan

Hi @Mike_Savvin , unfortunately no, we’re still facing the issue.
What version of MongoDB driver are you using? Is it the same version that I’ve been using?

@Rudik_Manucharyan now I’m using the latest one version 2.17.1 and still facing it

We were facing the same issue. In our case, it’s not exactly MongoDB driver’s fault. It was due to an issue with our RabbitMQ connection management that led to this issue. Instead of reusing the RabbitMQ connection, it was creating new connections and on top of it, the connection was not being closed. Looks like this exhausted all the available threads in the thread pool and no threads were remaining to be used by the mongodb driver to deserialize the data. Once the RabbitMQ connection reuse logic is fixed, this issue disappeared automatically. You could be facing something similar. Check if you are using up all your threads and blocking them anywhere in your application. Hope this helps.

1 Like