Skip to content
Snippets Groups Projects
Commit 2dee451d authored by jurgenhaas's avatar jurgenhaas
Browse files

Add core patch for D10 to prevent memory leaks

parent cb3a1474
No related branches found
No related tags found
1 merge request!374Merging develop into main
Pipeline #1372498 passed
......@@ -81,7 +81,8 @@
"#944582 File System Permissions": "https://www.drupal.org/files/issues/2024-01-16/944582-10.2.x-192.patch",
"#2849279 Inconsistent changed timestamps when moderated entity": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/2849279.patch",
"#3043725 Provide a Entity Handler for user cancellation": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3043725-104.diff",
"#3473763 locale_string_is_safe should accept \"<front>\" as being safe": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3473763.diff"
"#3473763 locale_string_is_safe should accept \"<front>\" as being safe": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3473763.diff",
"#3492453 Memory leak in DrupalKernel when installing modules": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3492453.diff"
},
"drupal/dashboards": {
"#3366586 Shortcut error": "https://git.drupalcode.org/project/dashboards/-/merge_requests/26.diff"
......
......@@ -81,7 +81,8 @@
"#944582 File System Permissions": "https://www.drupal.org/files/issues/2024-01-16/944582-10.2.x-192.patch",
"#2849279 Inconsistent changed timestamps when moderated entity": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/2849279.patch",
"#3043725 Provide a Entity Handler for user cancellation": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3043725-104.diff",
"#3473763 locale_string_is_safe should accept \"<front>\" as being safe": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3473763.diff"
"#3473763 locale_string_is_safe should accept \"<front>\" as being safe": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3473763.diff",
"#3492453 Memory leak in DrupalKernel when installing modules": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3492453.diff"
},
"drupal/dashboards": {
"#3366586 Shortcut error": "https://git.drupalcode.org/project/dashboards/-/merge_requests/26.diff"
......
diff --git a/core/lib/Drupal/Core/Installer/InstallerKernel.php b/core/lib/Drupal/Core/Installer/InstallerKernel.php
index 8f4f1c760dee0882ad0cff4f29dd8a5c3fe5d9c8..23f329eff551b67d86f8e2c69ebe7d26bd86e5ad 100644
--- a/core/lib/Drupal/Core/Installer/InstallerKernel.php
+++ b/core/lib/Drupal/Core/Installer/InstallerKernel.php
@@ -3,6 +3,7 @@
namespace Drupal\Core\Installer;
use Drupal\Core\DrupalKernel;
+use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Extend DrupalKernel to handle force some kernel behaviors.
@@ -83,4 +84,17 @@ public static function installationAttempted() {
return isset($GLOBALS['install_state']) && empty($GLOBALS['install_state']['installation_finished']);
}
+ /**
+ * {@inheritdoc}
+ */
+ protected function attachSynthetic(ContainerInterface $container): void {
+ parent::attachSynthetic($container);
+
+ // Reset any existing container in order to avoid holding on to old object
+ // references, otherwise memory usage grows exponentially with each rebuild
+ // when multiple modules are being installed.
+ // @todo Move this to the parent class after https://www.drupal.org/i/2066993
+ $this->container?->reset();
+ }
+
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment