-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rate limit requests for addons.xml.gz #271
Conversation
Rate limiting has been added to mirrors.kodi.tv which the multiple requests for the various repository addons.xml.gz will trigger. This adds some rate limiting, error handling and retry backoff to avoid the rate limit resulting in the addon checker failing
def __init__(self, version, path): | ||
super().__init__() | ||
self.version = version | ||
self.path = path | ||
self.addons = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this line should be moved back to where it was, so that the checker will fail if the versioned repository download fails due to some other server error that cannot be resolved by the allowed retries?
One issue with this PR is that, while it does prevent the rate limiting, it may allow for the possibility of the checker appearing to complete successfully, if some other server error occurs. In this instance the checker would just run with an empty list of addons for the versioned repository that failed to download. Perhaps this should still raise an exception? It was also suggested that not all these repositories (currently Gotham and up) should be checked anymore. Maybe only Leia and above? |
Could we not just send a specific header that will disable the rate limit for that call? The main reason we limit the rate is the normal repository fetching of addon.xml(.md5) that floods the servers. So we could perhaps differentiate on the agent header in the rate limiter? |
Yes, that is also an option, but would only apply to mirrors.kodi.tv itself. The actual mirrors themselves would not respond in the same manner. I updated the PR:
Should be a little bit more friendly to all the servers involved. Also moved the |
Thanks for working on this |
Just realised there is an issue with this PR if used with older distributions that have old versions of
Shall I create a PR for https://github.com/xbmc/addon-check/blob/master/requirements.txt to use this as the minimum version required? |
Thay makes sense. |
Rate limiting has been added to mirrors.kodi.tv which the multiple requests for the various repository addons.xml.gz will trigger.
This adds some rate limiting, error handling and retry backoff to avoid the rate limit resulting in the addon checker failing