msgraph-sdk-javascript icon indicating copy to clipboard operation
msgraph-sdk-javascript copied to clipboard

SDK doesn't appear to use Retry-After on 429s

Open gavinbarron opened this issue 3 years ago • 0 comments

Bug Report

Prerequisites

  • [X] Can you reproduce the problem?
  • [X] Are you running the latest version?
  • [X] Are you reporting to the correct repository?
  • [X] Did you perform a cursory search?

Description

During testing of a tool to simulate 429s on the network layer (i.e. outside of the JavaScript library) it was observed that a when a Retry-After or 5s was returned to the client application the SDK issued a retry request before the 5s window had elapsed

Console Errors: N/A

Screenshots:

Steps to Reproduce

  1. Use the ChaosProxy sample using the sdk and with the proxy running with 99% failure rate and only 429s as the allowed errors
  2. see that the a retry is sent before the 5s wait period is finished

Expected behavior: [What you expected to happen] SDK should not be retrying until after the number of seconds provided in the Retry-After header

Actual behavior: [What actually happened] SDK retries the request at 3s and eventually succeeds due to the exponential backoff behavior

Additional Context

Add any other context about the problem here.. Chaos Proxy is here: https://github.com/microsoftgraph/msgraph-chaos-proxy (Microsoft private repo at present)

Usage Information

Request ID - N/A

SDK Version - script link to https://cdn.jsdelivr.net/npm/@microsoft/microsoft-graph-client/lib/graph-js-sdk.js so I assume latest

  • [x] Browser (Check, if using Browser version of SDK)

Browser Name - Edge

Version - 105

gavinbarron avatar Sep 27 '22 10:09 gavinbarron