Skip to content

Commit

Permalink
Enhancing proxy retry logs (#10437)
Browse files Browse the repository at this point in the history
* Enhancing proxy retry logs

* removing double curly brace around second exception log statement

* adding double braces back

---------

Co-authored-by: Aishwarya Bhandari <37918412+aishwaryabh@users.noreply.github.com>
  • Loading branch information
fabiocav and aishwaryabh authored Aug 28, 2024
1 parent 44489a3 commit fc5c11b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/WebJobs.Script.Grpc/Server/RetryProxyHandler.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -41,6 +42,19 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage

await Task.Delay(currentDelay, cancellationToken);
}
catch (Exception ex)
{
if (attemptCount == _maxRetries)
{
_logger.LogWarning("Reached the maximum retry count for worker request proxying. Error: {exception}", ex);
}
else
{
_logger.LogWarning($"Unsupported exception type in {nameof(RetryProxyHandler)}. Request will not be retried. Exception: {{exception}}", ex);
}

throw;
}
}

// This should never be reached.
Expand Down

0 comments on commit fc5c11b

Please sign in to comment.