Scenario:
We were doing some heavy operations using Microsoft Graph and SharePoint APIs.
Ans as usual due to heavy operations we received 429 (Throttling) in the response.
But from previous experience, we had seen 'Microsoft Graph API' sends max 10-20s in 'retry-after' header. 'SharePoint API' had send up to 300s in 'retry-after' header.
But recently we have observed 'Microsoft Graph API' also sending 'Retry-After' header with high values.
Observations:
POST: "https://graph.microsoft.com/v1.0/drives/b!ctJlw490OkqH_ufKvIEcTSpVGwxmsGBLkHcQ2rjccZDzO2uAcpHkR5fGeT1QfF-F/items/01AWX3RQYDMEEOQFRILRDISIANYH4OIPZ2?$select=sharepointids"
RESPONSE:
Hitting endpoint for 1st Time
http-response: 429 Too Many Requests
headers:
'Retry-After' : 41
response-body:
{
"error": {
"code": "activityLimitReached",
"message": "The request has been throttled",
"innerError": {
"code": "throttledRequest",
"innerError": {
"code": "quota"
},
"date": "2021-11-30T12:17:46",
"request-id": "01c3bdb8-fbb1-4613-96ad-be961ba99e11",
"client-request-id": "01c3bdb8-fbb1-4613-96ad-be961ba99e11"
}
}
}
RESPONSE:
Hitting endpoint for 2nd Time
http-response: 429 Too Many Requests
headers:
'Retry-After' : 315
response-body:
{
"error": {
"code": "activityLimitReached",
"message": "The request has been throttled",
"innerError": {
"code": "throttledRequest",
"innerError": {
"code": "quota"
},
"date": "2021-11-30T12:18:27",
"request-id": "d4e33010-58e5-4dca-bb75-a340505e5c45",
"client-request-id": "d4e33010-58e5-4dca-bb75-a340505e5c45"
}
}
}
Question:
As you can see from above observations 'Retry-After' header received is '41' and '315' respectively, which are too huge.
Is there any range how high this can go, or some insides how exactly this 'Retry-After' header is determined ?