Skip to content
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

Enforce minimum interval between add-on repository updates #24886

Merged
merged 1 commit into from
Mar 24, 2024

Conversation

yol
Copy link
Member

@yol yol commented Mar 23, 2024

Description

Repository update can fail in a way that would lead to an immediate reschedule of the update. A common reason would be a failure to update the nextcheck column of the repo table. This leads to mirror and repository servers getting constantly hammered.

Since there is no reason to have a smaller update interval than an hour anyway, we just enforce this as the minimum in all regular updates. This should catch all possible errors leading to a continuous series of requests.

Motivation and context

#24829

How has this been tested?

Manual test stepping through common cases with the debugger on my machine.

What is the effect on users?

Their broken RPi will not saturate their internet connection any more...

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • Student submission (PR was done for educational purposes and will be treated as such)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

xbmc/addons/RepositoryUpdater.cpp Show resolved Hide resolved
xbmc/addons/RepositoryUpdater.h Outdated Show resolved Hide resolved
@ksooo
Copy link
Member

ksooo commented Mar 23, 2024

@yol Your PR is for master, thus v22. For Omega, you need to open a backport PR heading for Omega branch.

Repository update can fail in a way that would lead to an
immediate reschedule of the update. A common reason would be
a failure to update the `nextcheck` column of the `repo` table.
This leads to mirror and repository servers getting constantly
hammered.

Since there is no reason to have a smaller update interval than
an hour anyway, we just enforce this as the minimum in all
regular updates. This should catch all possible errors leading
to a continuous series of requests.

Fixes xbmc#24829.
@yol yol requested a review from lrusak March 23, 2024 11:58
Copy link
Member

@neo1973 neo1973 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm. Tested triggering updates manually and they happen immediately, didn't check for actual waiting for the regular update interval.

@yol yol merged commit ee0513a into xbmc:master Mar 24, 2024
2 checks passed
@yol yol deleted the repo-update-on-db-fail branch March 24, 2024 10:28
yol added a commit that referenced this pull request Mar 24, 2024
Backport #24886 " Enforce minimum interval between add-on repository updates"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport: Done Component: Add-ons Type: Fix non-breaking change which fixes an issue v22 "P"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Repeated addons.xml.gz download when unable to write to ~/.kodi/userdata/Database/AddonsXX.db
5 participants