From 7653e90deeb3d5ee41f24cbbe452a3c00c408463 Mon Sep 17 00:00:00 2001 From: Mikael Weaver Date: Fri, 17 Jan 2025 14:48:46 -0800 Subject: [PATCH] removed unnecessary exception logging --- .../Features/Health/CosmosHealthCheck.cs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/Microsoft.Health.Fhir.CosmosDb/Features/Health/CosmosHealthCheck.cs b/src/Microsoft.Health.Fhir.CosmosDb/Features/Health/CosmosHealthCheck.cs index 79bf4503cc..ad9fee7121 100644 --- a/src/Microsoft.Health.Fhir.CosmosDb/Features/Health/CosmosHealthCheck.cs +++ b/src/Microsoft.Health.Fhir.CosmosDb/Features/Health/CosmosHealthCheck.cs @@ -76,17 +76,6 @@ static bool IsRetryableException(Exception ex) => ex is CosmosOperationCanceledException || (ex is CosmosException cex && (cex.StatusCode == HttpStatusCode.ServiceUnavailable || cex.StatusCode == (HttpStatusCode)449)); - void LogAdditionalRetryableExceptionDetails(Exception exception) - { - if (exception is CosmosException cosmosException && cosmosException.StatusCode == HttpStatusCode.ServiceUnavailable) - { - _logger.LogWarning( - cosmosException, - "Received a ServiceUnavailable response from Cosmos DB. Retrying. Diagnostics: {CosmosDiagnostics}", - cosmosException.Diagnostics?.ToString() ?? "empty"); - } - } - do { cancellationToken.ThrowIfCancellationRequested(); @@ -107,7 +96,6 @@ void LogAdditionalRetryableExceptionDetails(Exception exception) // No reasons to retry as the cancellation was external to the health check. _logger.LogWarning(ex, "Failed to connect to the data store. External cancellation requested."); - LogAdditionalRetryableExceptionDetails(ex); return HealthCheckResult.Unhealthy( description: UnhealthyDescription, @@ -126,7 +114,6 @@ void LogAdditionalRetryableExceptionDetails(Exception exception) "Failed to connect to the data store. There were {NumberOfAttempts} attempts to connect to the data store, but they suffered a '{ExceptionType}'.", attempt, ex.GetType().Name); - LogAdditionalRetryableExceptionDetails(ex); return HealthCheckResult.Unhealthy( description: UnhealthyDescription, @@ -144,7 +131,6 @@ void LogAdditionalRetryableExceptionDetails(Exception exception) "Failed to connect to the data store. Attempt {NumberOfAttempts}. '{ExceptionType}'.", attempt, ex.GetType().Name); - LogAdditionalRetryableExceptionDetails(ex); } } catch (CosmosException ex) when (ex.IsCmkClientError())