From eb89f78632eb6e94fcbb25e484b0cb46a648ffb2 Mon Sep 17 00:00:00 2001 From: Raymond den Haan Date: Wed, 5 Mar 2025 14:52:30 +0100 Subject: [PATCH] Update retry configuration to retry up to 4 minutes --- src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs b/src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs index fb2763484..06b13b851 100644 --- a/src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs +++ b/src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs @@ -266,13 +266,13 @@ public abstract class SendHttpRequestBase : Activity .Handle() // Specific timeout exception .Handle() // Any HTTP exception .HandleResult(response => IsTransientStatusCode(response.StatusCode)), - MaxRetryAttempts = 4, + MaxRetryAttempts = 10, 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(60)); // Outer timeout. 30 secs plus a grace period of 30 secs for the last attempt. + .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(); }