0

See the logs, they're pretty descriptive! I've bolded the header.

Retry-After returns a value of 0, where an amount of milliseconds is expected. I'm currently falling back on exponential back-off, which is far from ideal in this case. The documentation and best practices instruct to fallback on exp. back-off when no Retry-After header is returned, but it is. And after 5 retries (my retry policy), I throw the exception, which shows that Microsoft Graph in fact expects me to wait 3 minutes. Can anyone confirm this is a bug, or am I doing something wrong after all?

Logs:

[Information] [RETRY] Date: Thu, 28 Oct 2021 11:55:37 GMTCache-Control: no-cacheTransfer-Encoding: chunkedRetry-After: 0Strict-Transport-Security: max-age=31536000request-id: 19c11610-2b14-4c82-abdd-ce9582eb1fe7client-request-id: 19c11610-2b14-4c82-abdd-ce9582eb1fe7x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West Europe","Slice":"E","Ring":"5","ScaleUnit":"004","RoleInstance":"AM2PEPF000050C2"}} 2021-10-28T11:55:38.492 [Information] [RETRY] StatusCode: 429, ReasonPhrase: 'Too Many Requests', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:{Date: Thu, 28 Oct 2021 11:55:37 GMTCache-Control: no-cacheTransfer-Encoding: chunkedRetry-After: 0Strict-Transport-Security: max-age=31536000request-id: 19c11610-2b14-4c82-abdd-ce9582eb1fe7client-request-id: 19c11610-2b14-4c82-abdd-ce9582eb1fe7x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West Europe","Slice":"E","Ring":"5","ScaleUnit":"004","RoleInstance":"AM2PEPF000050C2"}}Content-Type: application/json}

[Information] [RETRY] Retry-After provided in retry policy.

[Information] 0

[Information] [RETRY] Using Retry-After header for delay: 00:00:00

[Warning] [RETRY] Delaying for 0ms, then making retry 5.

[Error] [2219ab8a36038d2e] [3DDEDC39FE1ABC9D6C328F98503B08FB3FBEB35A223A91D424] Response status code does not indicate success: 429 (Too Many Requests).

[Warning] 429: Too many requests. Retrying after delay.

2021-10-28T11:55:38.524 [Error] Operation: Update; Exception: [Status Code: 429; Reason: Resource 'OData_GetSubscription__UserMailbox_0003bffd-18fb-b0eb-0000-000000000000_00000000-0000-0000-0000-000000000000' has reached limit of '250'. Please retry after '10/28/2021 11:58:13 AM']

kvn73
  • 11
  • 3
  • Are you using any SDK? and what happens when you honor the retry-after as set? Does your request still get throttled? From the docs, its looks like some times the retry would be missing. Not sure if 0 means the same thing as missing. – Danstan Nov 01 '21 at 07:15
  • Hey man. No, I'm not using any SDK: I'm using DI to provide ready HttpClients with retry policies (polly) to handle throttling and such. Simply honoring the retry-after as set will give 0ms delay, which will continue to return 429 responses with retry-after of 0ms. – kvn73 Nov 01 '21 at 09:19

1 Answers1

0

It resolved itself since today.

2021-11-11T15:08:11.101 [Information] [RETRY] StatusCode: 429, ReasonPhrase: 'Too Many Requests', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:{Retry-After: 1}Content-Type: application/json} 
2021-11-11T15:08:11.101 [Information] [RETRY] Using Retry-After header for delay: 00:00:00.0010000
kvn73
  • 11
  • 3