@@ -76,17 +76,6 @@ static bool IsRetryableException(Exception ex) =>
76
76
ex is CosmosOperationCanceledException ||
77
77
( ex is CosmosException cex && ( cex . StatusCode == HttpStatusCode . ServiceUnavailable || cex . StatusCode == ( HttpStatusCode ) 449 ) ) ;
78
78
79
- void LogAdditionalRetryableExceptionDetails ( Exception exception )
80
- {
81
- if ( exception is CosmosException cosmosException && cosmosException . StatusCode == HttpStatusCode . ServiceUnavailable )
82
- {
83
- _logger . LogWarning (
84
- cosmosException ,
85
- "Received a ServiceUnavailable response from Cosmos DB. Retrying. Diagnostics: {CosmosDiagnostics}" ,
86
- cosmosException . Diagnostics ? . ToString ( ) ?? "empty" ) ;
87
- }
88
- }
89
-
90
79
do
91
80
{
92
81
cancellationToken . ThrowIfCancellationRequested ( ) ;
@@ -107,7 +96,6 @@ void LogAdditionalRetryableExceptionDetails(Exception exception)
107
96
// No reasons to retry as the cancellation was external to the health check.
108
97
109
98
_logger . LogWarning ( ex , "Failed to connect to the data store. External cancellation requested." ) ;
110
- LogAdditionalRetryableExceptionDetails ( ex ) ;
111
99
112
100
return HealthCheckResult . Unhealthy (
113
101
description : UnhealthyDescription ,
@@ -126,7 +114,6 @@ void LogAdditionalRetryableExceptionDetails(Exception exception)
126
114
"Failed to connect to the data store. There were {NumberOfAttempts} attempts to connect to the data store, but they suffered a '{ExceptionType}'." ,
127
115
attempt ,
128
116
ex . GetType ( ) . Name ) ;
129
- LogAdditionalRetryableExceptionDetails ( ex ) ;
130
117
131
118
return HealthCheckResult . Unhealthy (
132
119
description : UnhealthyDescription ,
@@ -144,7 +131,6 @@ void LogAdditionalRetryableExceptionDetails(Exception exception)
144
131
"Failed to connect to the data store. Attempt {NumberOfAttempts}. '{ExceptionType}'." ,
145
132
attempt ,
146
133
ex . GetType ( ) . Name ) ;
147
- LogAdditionalRetryableExceptionDetails ( ex ) ;
148
134
}
149
135
}
150
136
catch ( CosmosException ex ) when ( ex . IsCmkClientError ( ) )
0 commit comments