-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.7.0, 2.8.0, 2.9.0, 2.10.2
-
Component/s: Operations, Write Operations
-
None
-
Environment:Windows 10 1903, .NET Core 2.1, Visual Studio 2019
I'm not sure if this is a driver issue or a breaking change with Atlas.
I only see the issue when I connect to an Atlas server, if I connect to a 3.12 replicaset server (on my local network) then the code example works fine.
I'm using the free version of Atlas in a 3 node replicaset configuration (default?). Nothing else configured.
var client = new MongoClient(...);
var database = client.GetDatabase(MongoUrl.Create(connectionString).DatabaseName);
var userAccounts = }}{{database.GetCollection<BsonDocument("userAccounts")
{{ .WithWriteConcern(WriteConcern.Acknowledged);}}
var logging =
{{ database}}.GetCollection<BsonDocument>("logging").WithWriteConcern(WriteConcern.Unacknowledged);
userAccounts.InsertOne(new BsonDocument());
await logging.InsertOneAsync(new BsonDocument());
{{userAccounts.InsertOne(new BsonDocument()); // <-- deadlock here }}
If I change the logging collection to be WriteConcern.Acknowledged then the deadlock goes away.
Async or Sync methods don't make any difference.
- is related to
-
JAVA-3608 updateOne blocked due to ?retryWriter=true and WriteConcern.UNACKNOWLEDGED combination
- Closed