Skip to content

Commit 7653e90

Browse files
committed
removed unnecessary exception logging
1 parent 03a7162 commit 7653e90

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/Microsoft.Health.Fhir.CosmosDb/Features/Health/CosmosHealthCheck.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,6 @@ static bool IsRetryableException(Exception ex) =>
7676
ex is CosmosOperationCanceledException ||
7777
(ex is CosmosException cex && (cex.StatusCode == HttpStatusCode.ServiceUnavailable || cex.StatusCode == (HttpStatusCode)449));
7878

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-
9079
do
9180
{
9281
cancellationToken.ThrowIfCancellationRequested();
@@ -107,7 +96,6 @@ void LogAdditionalRetryableExceptionDetails(Exception exception)
10796
// No reasons to retry as the cancellation was external to the health check.
10897

10998
_logger.LogWarning(ex, "Failed to connect to the data store. External cancellation requested.");
110-
LogAdditionalRetryableExceptionDetails(ex);
11199

112100
return HealthCheckResult.Unhealthy(
113101
description: UnhealthyDescription,
@@ -126,7 +114,6 @@ void LogAdditionalRetryableExceptionDetails(Exception exception)
126114
"Failed to connect to the data store. There were {NumberOfAttempts} attempts to connect to the data store, but they suffered a '{ExceptionType}'.",
127115
attempt,
128116
ex.GetType().Name);
129-
LogAdditionalRetryableExceptionDetails(ex);
130117

131118
return HealthCheckResult.Unhealthy(
132119
description: UnhealthyDescription,
@@ -144,7 +131,6 @@ void LogAdditionalRetryableExceptionDetails(Exception exception)
144131
"Failed to connect to the data store. Attempt {NumberOfAttempts}. '{ExceptionType}'.",
145132
attempt,
146133
ex.GetType().Name);
147-
LogAdditionalRetryableExceptionDetails(ex);
148134
}
149135
}
150136
catch (CosmosException ex) when (ex.IsCmkClientError())

0 commit comments

Comments
 (0)