Adjust hardcoded memory limit in getClusteredMigrationPlugins()

Created on 15 February 2024, 10 months ago
Updated 1 March 2024, 10 months ago

Problem/Motivation

There is a hardcoded override in getClusteredMigrationPlugins() which sets the memory limit to 512M. This can lead to a situation where the UI process stalls out and there is no clear way to address the issue

  public function getClusteredMigrationPlugins() : array {
    // Computing all clusters is very resource-intensive. For complex source
    // sites, the number of dependencies between migration plugins to analyze to
    // compute the appropriate clusters can be very high. Increase the memory
    // limit for the remainder of this request.
    ini_set('memory_limit', '512M');

    $all_migration_plugins = $this->getAvailableMigrationPlugins();

According to PHP docs, the memory limit override can be set from INI_ALL. This changeable mode value means it can be set from anywhere. I believe this means there is no way to set the memory limit to anything other than 512M without manually altering the underlying code in the module.

For example, a settings.php ini_set('memory_limit', -1) will get overridden when this code runs, every time

Steps to reproduce

n/a

Proposed resolution

Check the current memory limit first before overriding

Remaining tasks

Use this as an example.

User interface changes

n/a

API changes

n/a

Data model changes

n/a

πŸ“Œ Task
Status

Fixed

Version

1.9

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States dan612 Portland, Maine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024