Closed griffint61 closed 6 months ago
:+1:
This is an improvement, and is good as is. I also assume this is where most throttling happen.
But shouldn't all API calls (_conn.*
) be wrapped in an exponential backoff retry? Have you experienced throttling in other parts of the graffiti-monkey run (gathering instance lists, tags & so on)?
Yes, in principle they should all be wrapped. But in our case graffiti-monkey is not the victim of a rate-throttling condition, it is the cause. The other API calls, like gathering instance lists, are bulk operations that don't amount to that many hits, but the tagging is not a bulk operation so there are a lot of calls in a short period. For us this triggers a rate-throttling condition and is forcing our other scripts to back off, sometimes quite a lot. This change is mean to have graffiti-monkey do it's fair share of backing off at the time it is hitting the API the hardest so that our other scripts won't have to back off quite so much.
That said, I'm all for a general solution.
👍 yes please we are hitting api limits because of this as well
Adds exponential backoff for tagging API calls, and fixes a problem where the first sleep after a rate-limit exception was for zero seconds.