From f995ba6449efe12f6fe30e140ae1ee0545f36f22 Mon Sep 17 00:00:00 2001 From: Dariusz Stempniak Date: Fri, 25 Oct 2024 11:42:17 +0200 Subject: [PATCH] SNOW-1739583 Fix of rounding issue (#1045) --- Snowflake.Data/Core/HttpUtil.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Snowflake.Data/Core/HttpUtil.cs b/Snowflake.Data/Core/HttpUtil.cs index 3e779e34a..f835b7eb5 100755 --- a/Snowflake.Data/Core/HttpUtil.cs +++ b/Snowflake.Data/Core/HttpUtil.cs @@ -523,8 +523,7 @@ protected override async Task SendAsync(HttpRequestMessage // No need to wait more than necessary if it can be avoided. // If the rest timeout will be reached before the next back-off, // then use the remaining connection timeout. - // Math.Max with 0 in case totalRetryTime > restTimeout.TotalSeconds - backOffInSec = Math.Max(Math.Min(backOffInSec, (int)restTimeout.TotalSeconds - totalRetryTime), 0); + backOffInSec = Math.Min(backOffInSec, (int)restTimeout.TotalSeconds - totalRetryTime + 1); } } }