Polly icon indicating copy to clipboard operation
Polly copied to clipboard

AddTransientHttpErrorPolicy WaitAndRetry makes additional calls on Linux

Open l3m opened this issue 5 years ago • 0 comments

Building a AddTransientHttpErrorPolicy for HttpClients in DotNetCore/AspNetCore 3.1 makes additional calls on linux. It makes the expected amount of calls for Windows.



Expected behavior:

For a AddTransientHttpErrorPolicy with a timespan array with the following content:

            System.TimeSpan.FromSeconds(5.0),
            System.TimeSpan.FromSeconds(5.0)

I would expect a behavior as follows:

[12:54:09 INF] Start processing HTTP request GET https://mydomain.com/blah
[12:54:09 INF] Sending HTTP request GET https://mydomain.com/blah
[12:54:14 INF] Sending HTTP request GET https://mydomain.com/blah
[12:54:19 INF] Sending HTTP request GET https://mydomain.com/blah
[12:54:19 ERR] 


Actual behaviour:

This works as expected on Windows, but Linux makes additional calls:

[21:13:18 INF] Sending HTTP request GET https://mydomain.com/blah
[21:13:23 INF] Sending HTTP request GET https://mydomain.com/blah
[21:13:28 INF] Sending HTTP request GET https://mydomain.com/blah
[21:13:33 INF] Sending HTTP request GET https://mydomain.com/blah
[21:13:38 INF] Sending HTTP request GET https://mydomain.com/blah
[21:13:43 INF] Sending HTTP request GET https://mydomain.com/blah
[21:13:48 INF] Sending HTTP request GET https://mydomain.com/blah
[21:13:53 INF] Sending HTTP request GET https://mydomain.com/blah
[21:13:58 INF] Sending HTTP request GET https://mydomain.com/blah
[21:13:58 ERR] 


Steps / Code to reproduce the problem:

  • Add a AddTransientHttpErrorPolicy with above timespan array and disable the internet connection.

System:

  • dotnet version: 3.1.300
  • OS Win: Win 10 May 2020
  • OS Linux: Ubuntu 20.04 Focal Fossa
  • 64bit Intel CPU

l3m avatar Jun 23 '20 11:06 l3m