[CSHARP-2970] Deadlock using Atlas Created: 19/Feb/20  Updated: 09/Mar/20  Resolved: 09/Mar/20

Status: Closed
Project: C# Driver
Component/s: Operations, Write Operations
Affects Version/s: 2.7.0, 2.8.0, 2.9.0, 2.10.2
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Steven Ward Assignee: Dmitry Lukyanov (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 10 1903, .NET Core 2.1, Visual Studio 2019


Issue Links:
Related
is related to JAVA-3608 updateOne blocked due to ?retryWriter... Closed

 Description   

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.

 



 Comments   
Comment by Dmitry Lukyanov (Inactive) [ 09/Mar/20 ]

Hello steve.ward.uk@gmail.com, we’ve identified the root cause as a bug in Atlas. We are working on a fix.

Generated at Wed Feb 07 21:44:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.