500 Internal Server Error
Basically means that the server processing your request is busy. You are not the only developer accessing said server so if someone else made a very processor heavy request at the same time you sent your request well your request may timeout. As you mentioned google says we should implement exponential backoff in the case of 5xx errors.
The 410 response is primarily intended to assist the task of web maintenance by notifying the recipient that the resource is intentionally unavailable and that the server owners desire that remote links to that resource be removed. Such an event is common for limited-time, promotional services and for resources belonging to individuals no longer associated with the origin server's site. It is not necessary to mark all permanently unavailable resources as "gone" or to keep the mark for any length of time -- that is left to the discretion of the server owner.
This means that you waited to long before resending your request.
Implementing Exponential backoff.
Exponential backoff is the process of a client periodically retrying a failed request over an increasing amount of time. It is a standard error handling strategy for network applications. The Core Reporting API is designed with the expectation that clients which choose to retry failed requests do so using exponential backoff. Besides being "required", using exponential backoff increases the efficiency of bandwidth usage, reduces the number of requests required to get a successful response, and maximizes the throughput of requests in concurrent environments.
The flow for implementing simple exponential backoff is as follows.
- Make a request to the API
- Receive an error response that has a retry-able error code
- Wait 1s + random_number_milliseconds seconds
- Retry request
- Receive an error response that has a retry-able error code
- Wait 2s + random_number_milliseconds seconds
- Retry request
- Receive an error response that has a retry-able error code
- Wait 4s + random_number_milliseconds seconds
- Retry request
- Receive an error response that has a retry-able error code
- Wait 8s + random_number_milliseconds seconds
- Retry request
- Receive an error response that has a retry-able error code
- Wait 16s + random_number_milliseconds seconds
- Retry request
- If you still get an error, stop and log the error.
In the above flow, random_number_milliseconds is a random number of 1. milliseconds less than or equal to 1000. This is necessary to avoid certain lock errors in some concurrent implementations. random_number_milliseconds must be redefined after each wait.
Answer: There is no way to avoid the 500 errors you will get them from time to time. I think your issue is that yous say you are waiting after one minute to send your request that is why you are getting the 410 errors.
Note: I have logged a bug report requesting that the give a better example of Implementing Exponential Backoff for Google drive