Skip to content

Commit 8b334da

Browse files
committed
CSHARP-2229: Simplified test in IsResumableChangeStreamException method.
1 parent 4f792ce commit 8b334da

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/MongoDB.Driver.Core/Core/Operations/RetryabilityHelper.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ internal static class RetryabilityHelper
2323
// private static fields
2424
private static readonly HashSet<ServerErrorCode> __notResumableChangeStreamErrorCodes;
2525
private static readonly HashSet<Type> __resumableChangeStreamExceptions;
26-
private static readonly HashSet<ServerErrorCode> __resumableChangeStreamErrorCodes;
2726
private static readonly HashSet<Type> __retryableWriteExceptions;
2827
private static readonly HashSet<ServerErrorCode> __retryableWriteErrorCodes;
2928

@@ -54,13 +53,6 @@ static RetryabilityHelper()
5453
ServerErrorCode.SocketException
5554
};
5655

57-
__resumableChangeStreamErrorCodes = new HashSet<ServerErrorCode>(resumableAndRetryableErrorCodes)
58-
{
59-
ServerErrorCode.ElectionInProgress,
60-
ServerErrorCode.ExceededTimeLimit,
61-
ServerErrorCode.RetryChangeStream,
62-
};
63-
6456
__retryableWriteErrorCodes = new HashSet<ServerErrorCode>(resumableAndRetryableErrorCodes)
6557
{
6658
ServerErrorCode.WriteConcernFailed
@@ -81,7 +73,7 @@ public static bool IsResumableChangeStreamException(Exception exception)
8173
if (commandException != null)
8274
{
8375
var code = (ServerErrorCode)commandException.Code;
84-
return __resumableChangeStreamErrorCodes.Contains(code) || !__notResumableChangeStreamErrorCodes.Contains(code);
76+
return !__notResumableChangeStreamErrorCodes.Contains(code);
8577
}
8678
else
8779
{

0 commit comments

Comments
 (0)