Review main Merged

83023[BUGFIX] Avoid broken treelist cache

Sascha Nowak CR +2 V +2 Normal +12 −66 updated 02/21/24, 09:22

Commit message

The cache_treelist handling in PageRepository is broken
for a long time already: Entries are get() with an expiry
time that is not properly set(), so get() is never
successful.
There is a second bug in getDescendantPageIdsRecursive()
cache handling: get() is done without BE user restriction,
but set() is only done when no BE user is logged in. This
way, non-BE user state could swap into BE user state, *if*
the cache would work.

The patch avoids reading and writing the cache instead
of fixing cache access: We can not risk bugs in v12 if
the cache would suddenly start working but has side effects:
Issues like that would be hard to find, hard to report,
and have severe impact on FE rendering.

Note typical use case of the method are the "menu" content
elements, plus the extbase 'starting point' logic. So its
not the menu rendering in general - we would otherwise have
most likely found the broken cache much earlier.

The patch effectively increases performance since the
get() and set() queries are gone.

Review

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

Issues 1

Files 1

Review log 1316

  1. Sascha Nowak uploaded patch set 1 02/17/24, 09:46

  2. Sascha Nowak commented on patch set 1 02/17/24, 09:48

    PageRepository.php:1941

    I'm not 100% sure about the default lifetime. so I'm going for 24h
  3. core-ci voted on patch set 1 V +1 02/17/24, 09:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53272

  4. Christian Kuhn commented on patch set 1 CR -1 02/17/24, 13:33

    the missing expire is indeed a killer. did some quick tests already and found at least a second flaw in the method. hope it's ok to -1 for now, i'll put time into this soon, it needs to be fixed. great catch!
  5. Stefan Bürk commented on patch set 1 02/17/24, 14:48

    Reply

    good found @typo3@saschanowak.me - ack on the -1 for now, after quick check. There is more not in place (already before the change).
  6. Sascha Nowak uploaded patch set 2 CR -1 V +1 02/21/24, 05:46

  7. core-ci voted on patch set 2 V +1 02/21/24, 05:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53392

  8. Stefan Bürk voted on patch set 2 CR -1 02/21/24, 06:01

  9. Christian Kuhn commented on patch set 2 02/21/24, 08:06

    PageRepository.php:1941 Reply

    Done
  10. Christian Kuhn uploaded patch set 3 CR -1 V +1 02/21/24, 09:03

  11. core-ci voted on patch set 3 V +1 02/21/24, 09:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53407

  12. Christian Kuhn voted on patch set 3 CR +1 V +1 02/21/24, 09:10

  13. Stefan Bürk voted on patch set 3 CR +1 V +1 02/21/24, 09:19

  14. Christian Kuhn voted on patch set 3 CR +2 V +2 02/21/24, 09:21

  15. Christian Kuhn merged patch set 4 02/21/24, 09:21

  16. Christian Kuhn commented on patch set 4 02/21/24, 09:22

    Note Sascha, Benni, Stefan and me aligned on this strategy. v13 will receive further patches in this area.