[CSHARP-3307] Deadlock in ServerMonitor Created: 11/Jan/21  Updated: 13/Sep/21  Resolved: 11/Jan/21

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

Type: Bug Priority: Blocker - P1
Reporter: Aristarkh Zagorodnikov Assignee: Unassigned
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

.NET Framework 4.8 on Windows Server 2019
.NET Core 3.1 on Ubuntu 18.04 x64


Issue Links:
Duplicate
duplicates CSHARP-3302 SDAM deadlock when invalidating forme... Closed

 Description   

First of all, I kindly ask you to take a very close look at this. It is really important and can kill production systems in minutes. I believe this should be fixed and released for the 2.11 series as soon as possible.

There appears to be a deadlock in the connection management code that was introduced in the 2.11 driver series.
Due to the unfortunate decision not to ship debug symbols with the NuGet package, diagnosing it took more time than it should, but, well, let's take a look.

The problem manifests itself as a semi-permanent timeout (System.TimeoutException) for every operation directed to a MongoDB host. It is triggered by the host being restarted, thus being unavailable for heartbeats for a short time. Unfortunately, after the host gets up and running, not all clients successfully recover from this issue, with some of them entering the timeout of death state. Given that the issue appears to have a non-100% probability of occurrence did lead us to the idea that there is some race condition behind this. It occurs more frequently on .NET Core 3.1 running on Linux, probably due to how locking is implemented there, but .NET Framework 4.8 running on Windows is susceptible as well (in fact last time it occurred it killed about 40% of our backends).

Without much further mingling on the matter, let me present you a couple of stack traces. The first (thread 7256) is the same for about 1200 other threads, waiting on a lock held by thread 1400, which is in the second stack trace. It appears that parallel heartbeats (background vs directly requested) can lock these locks out of order since the heartbeat process itself (server description change handler) can try to request another heartbeat while being under the lock.

Thread 7256 is trying to lock the
MultiServerCluster._updateClusterDescriptionLock at MultiServerCluster.cs:278, while thread 1400 is trying to get a hold of a ServerMonitor._lock ServerMonitor.cs:146.

Thread 7256:

 	[Waiting on lock owned by Thread 1400, double-click or press enter to switch to thread]	
 	[Managed to Native Transition]	
>	MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Clusters.MultiServerCluster.ProcessServerDescriptionChanged(MongoDB.Driver.Core.Servers.ServerDescriptionChangedEventArgs args)	Unknown
 	MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Clusters.MultiServerCluster.ServerDescriptionChangedHandler(object sender, MongoDB.Driver.Core.Servers.ServerDescriptionChangedEventArgs args)	Unknown
 	MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Servers.Server.OnDescriptionChanged(object sender, MongoDB.Driver.Core.Servers.ServerDescriptionChangedEventArgs e)	Unknown
 	MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Servers.Server.OnMonitorDescriptionChanged(object sender, MongoDB.Driver.Core.Servers.ServerDescriptionChangedEventArgs e)	Unknown
 	MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Servers.ServerMonitor.OnDescriptionChanged(MongoDB.Driver.Core.Servers.ServerDescription oldDescription, MongoDB.Driver.Core.Servers.ServerDescription newDescription)	Unknown
 	MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Servers.ServerMonitor.HeartbeatAsync(System.Threading.CancellationToken cancellationToken)	Unknown
 	[Resuming Async Method]	
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result) Line 490	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<MongoDB.Driver.Core.Connections.IsMasterResult>.SetResult(MongoDB.Driver.Core.Connections.IsMasterResult result) Line 603	C#
 	[Completed] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Servers.ServerMonitor.GetIsMasterResultAsync(MongoDB.Driver.Core.Connections.IConnection connection, MongoDB.Driver.Core.WireProtocol.CommandWireProtocol<MongoDB.Bson.BsonDocument> isMasterProtocol, System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result) Line 490	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<MongoDB.Driver.Core.Connections.IsMasterResult>.SetResult(MongoDB.Driver.Core.Connections.IsMasterResult result) Line 603	C#
 	[Completed] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Connections.IsMasterHelper.GetResultAsync(MongoDB.Driver.Core.Connections.IConnection connection, MongoDB.Driver.Core.WireProtocol.CommandWireProtocol<MongoDB.Bson.BsonDocument> isMasterProtocol, System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result) Line 490	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<MongoDB.Bson.BsonDocument>.SetResult(MongoDB.Bson.BsonDocument result) Line 603	C#
 	[Completed] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol<MongoDB.Bson.BsonDocument>.ExecuteAsync(MongoDB.Driver.Core.Connections.IConnection connection, System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result) Line 490	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<MongoDB.Driver.Core.WireProtocol.Messages.ResponseMessage>.SetResult(MongoDB.Driver.Core.WireProtocol.Messages.ResponseMessage result) Line 603	C#
 	[Completed] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveMessageAsync(int responseTo, MongoDB.Driver.Core.WireProtocol.Messages.Encoders.IMessageEncoderSelector encoderSelector, MongoDB.Driver.Core.WireProtocol.Messages.Encoders.MessageEncoderSettings messageEncoderSettings, System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result) Line 490	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<MongoDB.Bson.IO.IByteBuffer>.SetResult(MongoDB.Bson.IO.IByteBuffer result) Line 603	C#
 	[Completed] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBufferAsync(int responseTo, System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result) Line 490	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<MongoDB.Bson.IO.IByteBuffer>.SetResult(MongoDB.Bson.IO.IByteBuffer result) Line 603	C#
 	[Completed] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBufferAsync(System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<System.Threading.Tasks.VoidTaskResult>.TrySetResult(System.Threading.Tasks.VoidTaskResult result) Line 490	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.SetResult(System.Threading.Tasks.VoidTaskResult result) Line 603	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.SetResult(System.Threading.Tasks.Task<System.Threading.Tasks.VoidTaskResult> completedTask) Line 638	C#
 	[Completed] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Misc.StreamExtensionMethods.ReadBytesAsync(System.IO.Stream stream, MongoDB.Bson.IO.IByteBuffer buffer, int offset, int count, System.TimeSpan timeout, System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<int>.TrySetResult(int result) Line 490	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int>.SetResult(int result) Line 603	C#
 	[Completed] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Misc.StreamExtensionMethods.ReadAsync(System.IO.Stream stream, byte[] buffer, int offset, int count, System.TimeSpan timeout, System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<int>.TrySetResult(int result) Line 490	C#
 	mscorlib.dll!System.Threading.Tasks.TaskFactory<int>.FromAsyncTrimPromise<System.IO.Stream>.Complete(System.IO.Stream thisRef, System.Func<System.IO.Stream, System.IAsyncResult, int> endMethod, System.IAsyncResult asyncResult, bool requiresSynchronization) Line 1438	C#
 	mscorlib.dll!System.Threading.Tasks.TaskFactory<int>.FromAsyncTrimPromise<System.IO.Stream>.CompleteFromAsyncResult(System.IAsyncResult asyncResult) Line 1412	C#
 	System.dll!System.Net.LazyAsyncResult.Complete(System.IntPtr userToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Line 917	C#
 	System.dll!System.Net.ContextAwareResult.Complete(System.IntPtr userToken)	Unknown
 	System.dll!System.Net.LazyAsyncResult.ProtectedInvokeCallback(object result, System.IntPtr userToken)	Unknown
 	System.dll!System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(uint errorCode, uint numBytes, System.Threading.NativeOverlapped* nativeOverlapped)	Unknown
 	mscorlib.dll!System.Threading._IOCompletionCallback.PerformIOCompletionCallback(uint errorCode, uint numBytes, System.Threading.NativeOverlapped* pOVERLAP) Line 135	C#
 	[Async Call Stack]	
 	[Async] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Servers.ServerMonitor.MonitorServerAsync()	Unknown

Thread 1400:

 	[Waiting on lock owned by Thread 7256, double-click or press enter to switch to thread]	
 	[Managed to Native Transition]	
>	MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Servers.ServerMonitor.RequestHeartbeat()	Unknown
 	MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Servers.Server.Invalidate(string reasonInvalidated, bool clearConnectionPool, MongoDB.Driver.Core.Servers.TopologyVersion responseTopologyVersion)	Unknown
 	MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Clusters.MultiServerCluster.ProcessReplicaSetChange(MongoDB.Driver.Core.Clusters.ClusterDescription clusterDescription, MongoDB.Driver.Core.Servers.ServerDescriptionChangedEventArgs args, System.Collections.Generic.List<MongoDB.Driver.Core.Servers.IClusterableServer> newServers)	Unknown
 	MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Clusters.MultiServerCluster.ProcessServerDescriptionChanged(MongoDB.Driver.Core.Servers.ServerDescriptionChangedEventArgs args)	Unknown
 	MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Clusters.MultiServerCluster.ServerDescriptionChangedHandler(object sender, MongoDB.Driver.Core.Servers.ServerDescriptionChangedEventArgs args)	Unknown
 	MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Servers.Server.OnDescriptionChanged(object sender, MongoDB.Driver.Core.Servers.ServerDescriptionChangedEventArgs e)	Unknown
 	MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Servers.Server.OnMonitorDescriptionChanged(object sender, MongoDB.Driver.Core.Servers.ServerDescriptionChangedEventArgs e)	Unknown
 	MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Servers.ServerMonitor.OnDescriptionChanged(MongoDB.Driver.Core.Servers.ServerDescription oldDescription, MongoDB.Driver.Core.Servers.ServerDescription newDescription)	Unknown
 	MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Servers.ServerMonitor.HeartbeatAsync(System.Threading.CancellationToken cancellationToken)	Unknown
 	[Resuming Async Method]	
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result) Line 490	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<MongoDB.Driver.Core.Connections.IsMasterResult>.SetResult(MongoDB.Driver.Core.Connections.IsMasterResult result) Line 603	C#
 	[Completed] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Servers.ServerMonitor.GetIsMasterResultAsync(MongoDB.Driver.Core.Connections.IConnection connection, MongoDB.Driver.Core.WireProtocol.CommandWireProtocol<MongoDB.Bson.BsonDocument> isMasterProtocol, System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result) Line 490	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<MongoDB.Driver.Core.Connections.IsMasterResult>.SetResult(MongoDB.Driver.Core.Connections.IsMasterResult result) Line 603	C#
 	[Completed] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Connections.IsMasterHelper.GetResultAsync(MongoDB.Driver.Core.Connections.IConnection connection, MongoDB.Driver.Core.WireProtocol.CommandWireProtocol<MongoDB.Bson.BsonDocument> isMasterProtocol, System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result) Line 490	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<MongoDB.Bson.BsonDocument>.SetResult(MongoDB.Bson.BsonDocument result) Line 603	C#
 	[Completed] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol<MongoDB.Bson.BsonDocument>.ExecuteAsync(MongoDB.Driver.Core.Connections.IConnection connection, System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result) Line 490	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<MongoDB.Driver.Core.WireProtocol.Messages.ResponseMessage>.SetResult(MongoDB.Driver.Core.WireProtocol.Messages.ResponseMessage result) Line 603	C#
 	[Completed] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveMessageAsync(int responseTo, MongoDB.Driver.Core.WireProtocol.Messages.Encoders.IMessageEncoderSelector encoderSelector, MongoDB.Driver.Core.WireProtocol.Messages.Encoders.MessageEncoderSettings messageEncoderSettings, System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result) Line 490	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<MongoDB.Bson.IO.IByteBuffer>.SetResult(MongoDB.Bson.IO.IByteBuffer result) Line 603	C#
 	[Completed] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBufferAsync(int responseTo, System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result) Line 490	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<MongoDB.Bson.IO.IByteBuffer>.SetResult(MongoDB.Bson.IO.IByteBuffer result) Line 603	C#
 	[Completed] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBufferAsync(System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<System.Threading.Tasks.VoidTaskResult>.TrySetResult(System.Threading.Tasks.VoidTaskResult result) Line 490	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.SetResult(System.Threading.Tasks.VoidTaskResult result) Line 603	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.SetResult(System.Threading.Tasks.Task<System.Threading.Tasks.VoidTaskResult> completedTask) Line 638	C#
 	[Completed] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Misc.StreamExtensionMethods.ReadBytesAsync(System.IO.Stream stream, MongoDB.Bson.IO.IByteBuffer buffer, int offset, int count, System.TimeSpan timeout, System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<int>.TrySetResult(int result) Line 490	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<int>.SetResult(int result) Line 603	C#
 	[Completed] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Misc.StreamExtensionMethods.ReadAsync(System.IO.Stream stream, byte[] buffer, int offset, int count, System.TimeSpan timeout, System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070	C#
 	mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810	C#
 	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617	C#
 	mscorlib.dll!System.Threading.Tasks.Task<int>.TrySetResult(int result) Line 490	C#
 	mscorlib.dll!System.Threading.Tasks.TaskFactory<int>.FromAsyncTrimPromise<System.IO.Stream>.Complete(System.IO.Stream thisRef, System.Func<System.IO.Stream, System.IAsyncResult, int> endMethod, System.IAsyncResult asyncResult, bool requiresSynchronization) Line 1438	C#
 	mscorlib.dll!System.Threading.Tasks.TaskFactory<int>.FromAsyncTrimPromise<System.IO.Stream>.CompleteFromAsyncResult(System.IAsyncResult asyncResult) Line 1412	C#
 	System.dll!System.Net.LazyAsyncResult.Complete(System.IntPtr userToken)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Line 917	C#
 	System.dll!System.Net.ContextAwareResult.Complete(System.IntPtr userToken)	Unknown
 	System.dll!System.Net.LazyAsyncResult.ProtectedInvokeCallback(object result, System.IntPtr userToken)	Unknown
 	System.dll!System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(uint errorCode, uint numBytes, System.Threading.NativeOverlapped* nativeOverlapped)	Unknown
 	mscorlib.dll!System.Threading._IOCompletionCallback.PerformIOCompletionCallback(uint errorCode, uint numBytes, System.Threading.NativeOverlapped* pOVERLAP) Line 135	C#
 	[Async Call Stack]	
 	[Async] MongoDB.Driver.Core.dll!MongoDB.Driver.Core.Servers.ServerMonitor.MonitorServerAsync()	Unknown



 Comments   
Comment by Esha Bhargava [ 11/Jan/21 ]

onyxmaster Thanks for reporting this issue! We plan to address this as soon as possible.

Comment by Aristarkh Zagorodnikov [ 11/Jan/21 ]

I see this is a duplicate of CSHARP-3302, I think this issue should be closed, and the priority of CSHARP-3302 boosted.

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