Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions src/MongoDB.Driver/Core/Connections/BinaryConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@ public ResponseMessage ReceiveMessage(
catch (Exception ex)
{
helper.FailedReceivingMessage(ex);
ThrowOperationCanceledExceptionIfRequired(ex);
throw;
}
}
Expand Down Expand Up @@ -457,7 +456,6 @@ public async Task<ResponseMessage> ReceiveMessageAsync(
catch (Exception ex)
{
helper.FailedReceivingMessage(ex);
ThrowOperationCanceledExceptionIfRequired(ex);
throw;
}
}
Expand Down Expand Up @@ -540,7 +538,6 @@ public void SendMessage(OperationContext operationContext, RequestMessage messag
catch (Exception ex)
{
helper.FailedSendingMessage(ex);
ThrowOperationCanceledExceptionIfRequired(ex);
throw;
}
}
Expand Down Expand Up @@ -577,7 +574,6 @@ public async Task SendMessageAsync(OperationContext operationContext, RequestMes
catch (Exception ex)
{
helper.FailedSendingMessage(ex);
ThrowOperationCanceledExceptionIfRequired(ex);
throw;
}
}
Expand Down Expand Up @@ -687,19 +683,6 @@ ex is OperationCanceledException ||
return new MongoConnectionException(_connectionId, message, ex);
}

private void ThrowOperationCanceledExceptionIfRequired(Exception exception)
{
if (exception is ObjectDisposedException objectDisposedException)
{
// We expect two cases here:
// objectDisposedException.ObjectName == GetType().Name
// objectDisposedException.Message == "The semaphore has been disposed."
// but since the last one is language-specific, the only option we have is avoiding any additional conditions for ObjectDisposedException
// TODO: this logic should be reviewed in the scope of https://jira.mongodb.org/browse/CSHARP-3165
throw new OperationCanceledException($"The {nameof(BinaryConnection)} operation has been cancelled.", exception);
}
}

// nested classes
private class OpenConnectionHelper
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,6 @@ private static void RequireKmsMock() =>
"collection.listIndexNames succeeds after retryable handshake network error",

// SDAM
#if NET472
// https://jira.mongodb.org/browse/CSHARP-3165
"Connection pool clear uses interruptInUseConnections=true after monitor timeout",
"Error returned from connection pool clear with interruptInUseConnections=true is retryable",
"Error returned from connection pool clear with interruptInUseConnections=true is retryable for write",
#endif
// "Not implemented: https://jira.mongodb.org/browse/CSHARP-3138"
"connectTimeoutMS=0",
// https://jira.mongodb.org/browse/CSHARP-4459
Expand Down
Loading