A customer is using a C# app that I work on and is encountering throttling issues with SharePoint Online. The app implements the suggested throttling handling by Microsoft. The code starts with a delay of 5 seconds and makes 5 attempts. After the last attempt that had a delay of 80 seconds, the throttling error code (429) was still returned. The throttling code seemed to not work at all since it ended up just failing after 5 attempts anyway. 80 seconds seems like a very long time to delay. Any ideas what could be causing this problem or how to go about troubleshooting it?
Make sure that your requests have a valid useragent entry. https://docs.microsoft.com/en-us/sharepoint/dev/general-development/how-to-avoid-getting-throttled-or-blocked-in-sharepoint-online
If you are using PnP try to add entry similar to listed below into AppSettings section of Web.config:
<add key="SharePointPnPUserAgent" value="NONISV|Steve|Steve.SharePointApp/1.0" />
I can verify that
ExecuteQueryWithIncrementalRetry works pretty well. I used it recently to push master page and page layout changes to 24,000 site collections. You might have some stray
ExecuteQueries in your code that are triggering the 429s. Make sure you clean all those up. Sniff the traffic to make sure there aren't any stray requests getting out. I did not need to use the user agent string.