From 7b4cb375deead6d5b4c2f39bb13d996dab025336 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Mon, 3 Mar 2025 11:05:16 +0100 Subject: [PATCH] Adjust timeout and backoff calculations in HTTP pipeline. Updated comments to correct total delay and grace period calculations for clarity and accuracy. This ensures consistency in expected retry behavior and improves maintainability. --- 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 273a24481..f2eb9d987 100644 --- a/src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs +++ b/src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs @@ -269,10 +269,10 @@ public abstract class SendHttpRequestBase : Activity MaxRetryAttempts = 4, 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 = 32. + 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. 32 secs plus grace period of 28 secs for the last attempt. + .AddTimeout(TimeSpan.FromSeconds(60)); // Outer timeout. 30 secs plus a grace period of 30 secs for the last attempt. return pipelineBuilder.Build(); }