Azure / azure-ruby-asm-core

Azure Ruby SDK Service Management Core HTTP
6 stars 32 forks source link

Initialize retry_data for each request #55

Closed d-tasaki closed 6 years ago

d-tasaki commented 6 years ago

I got a timeout error for ssl connection, but never retry even if RetryPolicy enabled.

azure_client = Azure::Storage::Client.create(storage_account_name: "xxx",
                                             storage_access_key: "xxx")
azure_client.storage_blob_host = "https://xxx.blob.core.windows.net"
@blob_client = azure_client.blob_client
@blob_client.with_filter(Azure::Storage::Core::Filter::ExponentialRetryPolicyFilter.new)

I set blob_client as above and I used it for uploading many files (over 400 files, it took over 2 minutes). Then AzureBlob returns timeout error like Errno::ETIMEDOUT: Failed to open TCP connection to xxx.blob.core.windows.net:443 (Connection timed out - connect(2) for "xxx.blob.core.windows.net" port 443). I expected retry the request but never retried it, because retry_data[:count] was already over 400 which exceeded DEFAULT_RETRY_COUNT = 3.

So I fixed retry_data in Azure::Core::Http::RetryPolicy to refresh each request.

msftclas commented 6 years ago

CLA assistant check
All CLA requirements met.

d-tasaki commented 6 years ago

The issue is similar to https://github.com/Azure/azure-ruby-asm-core/issues/51 which discussed about retry_data[:error] but also retry_data[:count] has same issue.

d-tasaki commented 6 years ago

57