|
The Dispose method of BinaryConnection has code to prevent it from being executed twice. See:
https://github.com/mongodb/mongo-csharp-driver/blob/ebc40a80278f79ab86ce19eb6b5656044ee56c65/src/MongoDB.Driver.Core/Core/Connections/BinaryConnection.cs#L172
But if one thread calls Dispose while another thread is in the middle of opening the connection a race condition exists where the _state of the connection can be changed away from Disposed allowing the body of the Dispose method to subsequently be executed a second time.
|