[CSHARP-1882] Find throws ArgumentNullException on replica set failover Created: 06/Jan/17  Updated: 11/Feb/19  Resolved: 11/Feb/19

Status: Closed
Project: C# Driver
Component/s: Connectivity
Affects Version/s: 2.3
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Aristarkh Zagorodnikov Assignee: Unassigned
Resolution: Done Votes: 1
Labels: connection, exception, failover
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mongodb 3.2.11



 Description   

When replica set failover ocurs, the running client sometimes receives these exceptions:

System.ArgumentNullException: Value cannot be null.
Parameter name: serverVersion
   at MongoDB.Driver.Core.Misc.Ensure.IsNotNull[T](T value, String paramName)
   at MongoDB.Driver.ReadConcern.ThrowIfNotSupported(SemanticVersion serverVersion)
   at MongoDB.Driver.Core.Operations.FindCommandOperation`1.CreateCommand(ServerDescription serverDescription)
   at MongoDB.Driver.Core.Operations.FindCommandOperation`1.ExecuteCommand(IReadBinding binding, ServerDescription serverDescription, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Operations.FindCommandOperation`1.Execute(IReadBinding binding, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Operations.FindOperation`1.Execute(IReadBinding binding, CancellationToken cancellationToken)
   at MongoDB.Driver.OperationExecutor.ExecuteReadOperation[TResult](IReadBinding binding, IReadOperation`1 operation, CancellationToken cancellationToken)
   at MongoDB.Driver.MongoCollectionImpl`1.ExecuteReadOperation[TResult](IReadOperation`1 operation, ReadPreference readPreference, CancellationToken cancellationToken)
   at MongoDB.Driver.MongoCollectionImpl`1.ExecuteReadOperation[TResult](IReadOperation`1 operation, CancellationToken cancellationToken)
   at MongoDB.Driver.MongoCollectionImpl`1.FindSync[TProjection](FilterDefinition`1 filter, FindOptions`2 options, CancellationToken cancellationToken)

A second or two after failover the system returns to normal, so it looks like a race condition.
The target replica set is running mongodb 3.2.11.



 Comments   
Comment by Ian Whalen (Inactive) [ 11/Feb/19 ]

onyxmaster apologies for the delay in responding here - we believe that we've fixed this in a recent version of the driver since we now rely on the server version from the connection description rather than the cluster description.

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