Problem/Motivation

update.settings.yml says:

check:
  disabled_extensions: false
  interval_days: 1

If this value is set to 0 or lower, the logic in update_cron() pulls down update data from d.o on every cron run, for every multisite that has update module enabled.

This is a costly for d.o which has to handle these requests for all sites everywhere.

Proposed resolution

Add a usefulness check on the days-before-next-check value so that it never falls below one.

Allow arbitrary days-until-check settings to encourage even longer intervals, which means less bandwidth cost for the Drupal Association.

Document or somehow encourage users to disable update module on redundant sites, such as multisite.

Remaining tasks

There will likely be a follow-up where the update API is redesigned to be more efficient and scalable.

User interface changes

The settings form for the days-until-check setting will change from a 1 or 7 day dropdown to a numeric setting if the user has changed the value in some other way.

The user can issue a Drush command such as drush cset update.settings check.interval_days 23 and this value will then be reflected in the UI. If they change it back to 1 or 7, the dropdown will return.

API changes

Data model changes

CommentFileSizeAuthor
#20 numeric_settings.png197.91 KBMile23

Issue fork drupal-2853729

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mile23 created an issue. See original summary.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

This was a random bug for triage at DrupalSouth 2022. I searched core for interval_days and didn't find anything to suggest that this has been fixed. Leaving as an active bug.

Mile23’s picture

Hah. I remember having this conversation with @Mixologic.

Mile23’s picture

Status: Active » Needs review
Issue tags: +Needs documentation

OK, so how do you get 0 in that config?

Perhaps you found the YAML in your config directory and modified it.

Perhaps you issued a command like this: drush cset update.settings check.interval_days 0

Perhaps it's left over from a bad migration.

What matters is that we stop the bleeding for the Drupal Association.

What do we do about it?

We can add a value check to update_cron() which will make sure that a value of 0 is treated as a value of 1. We should include a log entry about this, so the log entries pile up and become visible. This might even prompt the user to uninstall update module from duplicate sites if they realize what’s happening.

We can add a value check to update_requirements(), which will show the user that they need to change the value of this config. Also we should link them to the admin page to do it.

So now the user is looking at the admin page. They are given two choices for update frequency: Daily and weekly. If they previously had it set to 0, they'll default to daily. They can just hit submit and they're done.

Still to do:

Figure out documentation for this so we can link it from the log entry and requirements page.

Mile23’s picture

larowlan’s picture

We could also consider adding an update hook here to convert it from <1 to 1 but that complicates things (update path tests, minor only etc)

Mile23’s picture

Concerns about 7+ gave me pause as well, but I didn't feel like researching the discussion that landed on 1 or 7 exclusively. :-)

I thought about switching the form to use a number field if it's not 1 or 7, but that would be a big change. Otherwise the form never validates if it's still radio buttons.

Mile23’s picture

FileSize
197.91 KB

The Update settings form now switches to a numeric input if you have a value other than daily or weekly.

numeric entry

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs issue summary update

This issue is being reviewed by the kind folks in Slack, #need-reveiw-queue. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge require as a guide.

Reading the modules and the MR there appear to be some unresolved threads in the MR so moving back to NW for that.

Mile23’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

Updated IS. Still NW.

Mile23’s picture

Issue summary: View changes
Status: Needs work » Needs review

Addressed @larowlan's concerns: Frequency is coerced to integer, test is now a kernel test instead of a functional one.

smustgrave’s picture

This issue is being reviewed by the kind folks in Slack, #need-reveiw-queue. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge require as a guide.

Removing credit from myself as I had to rebase the MR to get the tests to run now that the composer issue is resolved.

Reviewing the MR and it does appear 2 of 3 threads are resolved the one open is

should we cast $frequency to an int because we're doing strict comparisons here or is the config system guaranteed to return the right primitive type?

But see an explanation #23 addresses that.

While the tests run question can this move forward while tagged Needs documentation?

smustgrave’s picture

Status: Needs review » Needs work

Tests appear all green. The one failure seems to be random ckeditor javascript one.

Moving to NW for the "needs documentation" tag. If no longer needed then +1 for RTBC.

Mile23’s picture

Status: Needs work » Needs review
Issue tags: -Needs documentation
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the follow up

That was the only blocker from my original review so this looks good to me.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Added some review comments to the MR.

Mile23’s picture

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.