Review main Abandoned

93787[WIP][TASK] Clarify PackageStates.php cache identifier generation

Helmut Hummel CR 0 V -1 Easy +2 −2 updated 04/23/26, 12:08

Commit message

Assumptions stated in https://review.typo3.org/c/Packages/TYPO3.CMS/+/93749
turn out to be wrong or besides the point.

In TYPO3 classic mode this is the timeline of
typical PackageStates.php modifications:

- PackageStates.php created: 1.1.1970 00:00:00
- PackageStates.php ext installed: 1.1.1970 00:01:02
- PackageStates.php ext installed: 1.2.1970 12:01:02
- PackageStates.php ext removed: 1.2.1970 12:04:02

Citing the commit message:

> 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 one second resolution does not matter at all. It only matters,
when a file is CHANGED within one second multiple times.
This can
not be distinguished PHP wise. However, this is never the case within TYPO3.

What caused the bug is not the 1 sek resolution but the statcache.

When not flushed, the stat on the same file will return the same value
during one request.

Thus adding the file size to the identifier did not fix the bug, but
adding the clearstatcache()

Now clarify the test to emulate exactly that:

Stat on a file that is created some seconds/minutes/days ago

change that file

Stat again.

Without clearstatcache this test fails, no matter how many stats
are added to the identifier, because all are pulled from the
PHP statcache.

Can be verified by commenting clearstatcache(); in invalidate(),
which makes the test fail, even with filesize stat being used

Review

  • Code review CR 0
  • Verified V -1
    • core-ci -1 CI

Files 1

Review log 35

  1. Helmut Hummel uploaded patch set 1 04/21/26, 17:28

  2. Helmut Hummel marked it work in progress 04/21/26, 17:28

  3. core-ci voted on patch set 1 V -1 04/21/26, 17:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100665

  4. core-ci commented on patch set 1 04/21/26, 18:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100665

  5. Helmut Hummel abandoned the change 04/23/26, 12:08