Needs work
Project:
Drupal core
Version:
main
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Sep 2026 at 15:45 UTC
Updated:
1 Oct 2026 at 07:51 UTC
Jump to comment: Most recent
DrupalKernel::classLoaderAddMultiplePsr4() calls ClassLoader::addPsr4() without checking which paths have already been registered. Composer's loader appends the paths, so every boot and container rebuild adds another set. On persistent app servers (e.g., FrankenPHP worker mode), the loader grows with every request, and autoload misses get slower as the number of duplicates increases.
$kernel->boot(); $kernel->shutdown(); several times on one kernel, then boot it again.$autoloader->getPrefixesPsr4()['Drupal\\system\\']. The same path appears once per boot.Pass addPsr4() only the paths that are not yet registered. Keep the existing order, including paths added outside the kernel.
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:
Comments
Comment #3
ptmkenny commentedComment #4
daffie commentedComment #5
ptmkenny commentedI fixed the review comment and added a few more points to the test as well as some clarifying comments.
Comment #6
daffie commentedBack to NW, for the comment from @nicxvan.