Skip to content

Commit fc5c11b

Browse files
Enhancing proxy retry logs (#10437)
* Enhancing proxy retry logs * removing double curly brace around second exception log statement * adding double braces back --------- Co-authored-by: Aishwarya Bhandari <[email protected]>
1 parent 44489a3 commit fc5c11b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/WebJobs.Script.Grpc/Server/RetryProxyHandler.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

4+
using System;
45
using System.Net.Http;
56
using System.Threading;
67
using System.Threading.Tasks;
@@ -41,6 +42,19 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
4142

4243
await Task.Delay(currentDelay, cancellationToken);
4344
}
45+
catch (Exception ex)
46+
{
47+
if (attemptCount == _maxRetries)
48+
{
49+
_logger.LogWarning("Reached the maximum retry count for worker request proxying. Error: {exception}", ex);
50+
}
51+
else
52+
{
53+
_logger.LogWarning($"Unsupported exception type in {nameof(RetryProxyHandler)}. Request will not be retried. Exception: {{exception}}", ex);
54+
}
55+
56+
throw;
57+
}
4458
}
4559

4660
// This should never be reached.

0 commit comments

Comments
 (0)