Please sign in to comment.
Retry 403s and Net::HTTPBadResponse errors.
My testing strongly suggests that when GitHub returns status code 403 the request can be retried. This may be how they implement rate limiting. So, if we get a 403 we simply repeat the request. We don't wait between requests because there is not yet any evidence that it would benefit us. Hopefully, once the rate limiting is documented, we can revisit this issue. We also retry on Net::HTTPBadResponse exceptions. These are typically raised when something between the client and the server clobbers the response, so repeating the request is the most sensible approach. We don't limit the number of retries which means this code could end up looping forever. I'm loath to specify some arbitrary limit, however, without documentation on what to expect. For example, in the case of 403 errors, my testing reveals that sometimes we succeed after retrying twice, and other times it may take nearly ten retries.
- Loading branch information...