From 5a3be276e0be5ac60f415b5fb2be002f2ebf612e Mon Sep 17 00:00:00 2001 From: Raymond den Haan Date: Thu, 6 Mar 2025 12:04:02 +0100 Subject: [PATCH] Update HTTP resiliency configuration Removed outer timeout since it was not working in the current set-up Reduced maximum retry attempts to reduce the maximum amount of time spent on the request --- src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs b/src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs index 06b13b851..e9d660d5d 100644 --- a/src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs +++ b/src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs @@ -266,13 +266,12 @@ public abstract class SendHttpRequestBase : Activity .Handle() // Specific timeout exception .Handle() // Any HTTP exception .HandleResult(response => IsTransientStatusCode(response.StatusCode)), - MaxRetryAttempts = 10, + MaxRetryAttempts = 8, UseJitter = false, // If enabled, adds a random value between -25% and +25% of the calculated Delay, except if BackoffType is Exponential, where a DecorrelatedJitterBackoffV2 formula is used for jitter calculation. That formula is based on Polly.Contrib.WaitAndRetry. Delay = TimeSpan.FromSeconds(1), BackoffType = DelayBackoffType.Exponential // Delay * 2^AttemptNumber, e.g. [ 2s, 4s, 8s, 16s ]. Total secs: 2 + 4 + 8 + 16 = 30 // If BackoffType is Exponential, then the calculated Delay is multiplied by a random value between -25% and +25% of the calculated Delay, except if BackoffType is Exponential, where a DecorrelatedJitterBackoffV2 formula is used for jitter calculation. That formula is based on Polly.Contrib.WaitAndRetry. - }) - .AddTimeout(TimeSpan.FromSeconds(4*60)); // Outer timeout. 4 minutes, to stay well within range of the default lock time of servicebus messages. + }); return pipelineBuilder.Build(); }