Problem/Motivation

The database update password_policy_update_8302() fails for sites with a sufficiently large number of user accounts.

Steps to reproduce

Install this module in a site with a large number of users. I observed this problem in a site with about 70,000 users. You can use the devel_generate module in a test site to create user accounts; I'm not clear on the minimum number of accounts necessary to reproduce the problem.

When I ran database updates at the command line via drush updb, the server responded with out of memory errors. Increasing php memory limit available at the command line did not help.

Proposed resolution

Use a batch process for password_policy_update_8302().

Remaining tasks

Patch forthcoming.

Comments

COBadger created an issue. See original summary.

cobadger’s picture

Assigned: cobadger » Unassigned
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new2.18 KB

Patch attached.

cobadger’s picture

cobadger’s picture

StatusFileSize
new1.86 KB

Updated patch, as previous patch did not apply.

dpolant’s picture

I believe there is a problem with the completion calc logic in the previous patch - when I ran it, it did not finish. I've attached a modified version. Please test when you have time.

Thanks!

damienmckenna’s picture

+1 on the changes in #5, it works around a (potentially rare) problem where $user->getAccountName() is empty and could result in the progress counter falling out of sync with the record count.

That said, I have not tested it.

paulocs’s picture

Status: Needs review » Reviewed & tested by the community

Just tested it! The changes in #5 makes sense.
Thank you!

  • paulocs committed 8b78b1c on 8.x-3.x authored by dpolant
    Issue #3236412 by COBadger, dpolant, DamienMcKenna, paulocs: Use batch...
paulocs’s picture

Status: Reviewed & tested by the community » Fixed
  // Run user updates in batches of 50.
  $limit = 50;

Fixed the comment above on commit.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.