Review 13.4 Merged

93774[BUGFIX] Combine mtime and filesize for package cache identifier

Garvin Hicking CR +2 V +2 Normal +78 −5 updated 04/21/26, 08:27

Commit message

Installing an extension via the Extension Manager can dump a DI
container in which the just-activated extension's services are missing
entirely. Any code path that touches those services during activation
breaks the same way, regardless of whether it is a direct container
lookup, a tagged service, a registered event listener or an
instantiation from a TCA override.

The DI container cache identifier was derived from the PackageStates.php
mtime, which has 1-second resolution. When savePackageStates() rewrote
the file in the same wall-clock second that Bootstrap had previously
stat'd it, the identifier was identical to the one used for the
pre-activation container, and that stale cache.di entry was loaded for
the new package set. The just-activated extension's Services.yaml never
made it into the compiled container. Retries did not recover because
activatePackage() early-returns when the package is already active,
leaving the file untouched and the poisoned cache entry in place.

PackageStatesPackageCache::getIdentifier() now combines filemtime() and
filesize() via a single stat() call instead of relying on filemtime()
alone, eliminating the timestamp-resolution race at the cost of only
two extra metadata fields rather than a full file read.

Additionally the PHP stat cache is cleared, when invalidating the
identifier to make sure PHP does not use the cache on next stat() call

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Garvin Hicking +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 45

  1. Garvin Hicking commented on patch set 1 04/21/26, 06:48

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 04/21/26, 06:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100625

  3. Garvin Hicking commented on patch set 1 CR +1 V +1 04/21/26, 08:11

    ping @stefan@buerk.tech for backport yay/nay?
  4. Stefan Bürk commented on patch set 1 CR +2 V +2 04/21/26, 08:26

    Reply

    Acknowledged
  5. Stefan Bürk merged patch set 2 04/21/26, 08:27