Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm-storage fails to handle retry headers #7989

Closed
1 of 6 tasks
aiwilliams opened this issue Mar 24, 2020 · 6 comments
Closed
1 of 6 tasks

arm-storage fails to handle retry headers #7989

aiwilliams opened this issue Mar 24, 2020 · 6 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request This issue requires a new behavior in the product in order be resolved. Mgmt This issue is related to a management-plane library. Storage Storage Service (Queues, Blobs, Files)

Comments

@aiwilliams
Copy link

  • Package Name: arm-storage
  • Package Version: 13.1.0
  • Operating system: MacOS 10.15.3
  • nodejs
    • version: 12.13.1
  • browser
    • name/version:
  • typescript
    • version:
  • Is the bug related to documentation in

Describe the bug
When a 429 response is returned from a resource list endpoint, the DeserializationPolicy will throw a RestError so the ThrottlingRetryPolicy never gets a chance to try again.

listOperationSpec only support two responses:

         {
            200: {
                bodyMapper: ListContainerItems
            },
            default: {
                bodyMapper: CloudError
            }
         }

To Reproduce
Steps to reproduce the behavior:

  1. Instantiate an instance of the StorageManagementClient and fire off a couple hundred Promises that invoke client.storageAccounts.list(). AppConfigurationClient does not retry when a request is throttled #6408 provides a good example.

Expected behavior
A 429 response should be retried, not cause the DeserializationPolicy to kill the policy chain.

@xirzec xirzec added customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. Storage Storage Service (Queues, Blobs, Files) labels Mar 24, 2020
@dw511214992 dw511214992 assigned dw511214992 and unassigned qiaozha Mar 25, 2020
@dw511214992
Copy link
Member

Create an issue for codegen team to fix this issue: Azure/autorest.typescript#597

@aiwilliams
Copy link
Author

I've worked around this by:

new StorageManagementClient(this.auth.credentials, this.auth.subscriptionId, {
      noRetryPolicy: true, // <-- This removes retry policies so they can be added after the Deserialization
      requestPolicyFactories: (
        defaultRequestPolicyFactories: RequestPolicyFactory[],
      ): RequestPolicyFactory[] => {
        const policyChain = [
          ...defaultRequestPolicyFactories,
          exponentialRetryPolicy(), // < -- This will not retry a 429 response
          systemErrorRetryPolicy(),
          throttlingRetryPolicy(), // < -- This thing will only retry once
        ];
        return policyChain;
      },
    });

I now realize this may be a problem better reported to ms-rest-js, because the defaultRequestPolicyFactories come from the super class of StorageManagementClient -> AzureServiceClient -> ServiceClient.

FWIW, the API answers a 429 response which the ThrottlingRetryPolicy handles once with a retry, but when that also returns a 429, it doesn't try again. The API says Retry-After 17, but the request is still rejected with a 429 and another Retry-After 17. I wish the API would return a time that is more likely to work out. That is, I would have liked to see the API drive the retries, so that we could easily burst under 100 requests and throttle back based on meaningful responses from the API. Instead, I'm going to have to use p-throttle to proactively throttle and spread 100 requests out over 5 minutes.

@dw511214992
Copy link
Member

Thank you @aiwilliams for your information. Will involve service team to check if service can return a time.

@dw511214992 dw511214992 added the Service Attention Workflow: This issue is responsible by Azure service team. label May 19, 2020
@ghost
Copy link

ghost commented May 19, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

@ramya-rao-a ramya-rao-a removed the Service Attention Workflow: This issue is responsible by Azure service team. label Jul 19, 2020
@ghost ghost added the needs-team-triage Workflow: This issue needs the team to triage. label Jul 19, 2020
@ramya-rao-a ramya-rao-a added the feature-request This issue requires a new behavior in the product in order be resolved. label Jul 19, 2020
@ramya-rao-a ramya-rao-a added this to the Backlog milestone Jul 19, 2020
@ramya-rao-a
Copy link
Contributor

This issue depends on Azure/ms-rest-js#394 being fixed

@ramya-rao-a ramya-rao-a removed the needs-team-triage Workflow: This issue needs the team to triage. label Jul 19, 2020
@dw511214992
Copy link
Member

dw511214992 commented Feb 19, 2021

As Azure/ms-rest-js#394 fixed and the package released, please use this new feature in the latest @azure/ms-js-rest.
close it, and please open it if you have any more issues. thanks

@xirzec xirzec removed this from the Backlog milestone May 18, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request This issue requires a new behavior in the product in order be resolved. Mgmt This issue is related to a management-plane library. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

5 participants