sociomantic-tsunami / neptune

Sociomantic library versioning definitions, guides, and tools
Boost Software License 1.0
1 stars 15 forks source link

autopr: Try harder to fix timeout problems in GitHub queries #248

Open leandro-lucarella-sociomantic opened 5 years ago

leandro-lucarella-sociomantic commented 5 years ago

When fetching items, there is the chance that the query to GitHub times out because there is too much processing to do (there is a 10 seconds timeout from GitHub). In that case an easy fix is to retry but fetching less items at the time.

At some point an option was added (--num-entries) to mitigate this, but still if the timeout is reached depends on the nature of the query and the load of GitHub servers, so we need something more adaptative.

I think a better way to handle this would be to catch the exception and doing some sort of exponential back-off. Try first with the number passed by argument, if that fails with half of that and so on until there is only one item to fetch and if that fails too, then finally give up.