Skip to content

Commit

Permalink
SNOW-1739483 fix for System.ArgumentOutOfRangeException
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-dstempniak committed Oct 22, 2024
1 parent ebc6da8 commit 0ad40f6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Snowflake.Data/Core/HttpUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,9 @@ protected override async Task<HttpResponseMessage> 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
backOffInSec = Math.Min(backOffInSec, (int)restTimeout.TotalSeconds - totalRetryTime);
// 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);
}
}
}
Expand Down

0 comments on commit 0ad40f6

Please sign in to comment.