Review main Merged

94562[BUGFIX] Avoid endless recursion in workspace dependencies

Philipp Kitzberger CR +2 V +2 Hard +421 −16 updated 09/02/26, 16:01

Commit message

Workspaces dependency graphs may contain circular references, for
example through FlexForm or inline relations. If such a cycle is
reachable from an outer parent, the Workspaces module recursively
walks the same elements until PHP exhausts the memory limit.

CollectionService now keeps track of the branch it is currently
traversing and skips child edges that point back to an ancestor.
It also remembers the contexts an element has been resolved in, so
densely cross referenced structures are not walked along every
possible path through the graph anymore: ten elements referencing
each other needed 986420 traversal steps and about 2 GB of memory,
they need 56 steps now.

ElementEntity::getNestedChildren() did terminate on cycles, but
only because it memoizes the incomplete intermediate result of a
traversal that is still running. Elements were therefore missing
from the dependency structure CommandMap uses to publish, stage
and discard a set of related records. Nested children are now
collected with an explicit list of visited elements.

Add regression tests for reachable circular dependency graphs.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oliver Klee +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 5

Review log 1520

  1. Philipp Kitzberger uploaded patch set 1 06/24/26, 09:52

  2. core-ci voted on patch set 1 V -1 06/24/26, 10:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103801

  3. Philipp Kitzberger uploaded patch set 2 V -1 06/24/26, 10:08

  4. core-ci voted on patch set 2 V +1 06/24/26, 10:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103803

  5. Oliver Klee voted on patch set 2 V +1 07/03/26, 12:35

  6. Oliver Klee commented on patch set 2 07/03/26, 16:21

    Are 14.3 and 13.4 affected as well? (Haven't checked.)
  7. Philipp Kitzberger commented on patch set 2 07/06/26, 07:05

    Reply

    Yes, they are! Should I add those version numbers as well?
  8. Oliver Klee updated the commit message in patch set 3 V +1 07/06/26, 10:00

  9. Oliver Klee commented on patch set 3 V +1 07/06/26, 10:01

    Reply

    I've added them now.
  10. core-ci voted on patch set 3 V +1 07/06/26, 10:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104395

  11. Simon Schaufelberger voted on patch set 3 CR +1 V +1 07/07/26, 00:21

  12. Benni Mack uploaded patch set 4 CR +1 V +1 09/02/26, 14:52

  13. core-ci voted on patch set 4 V +1 09/02/26, 14:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107643

  14. Benni Mack updated the commit message in patch set 5 V +1 09/02/26, 15:00

  15. Benni Mack voted on patch set 5 CR +1 V +1 09/02/26, 15:00

  16. core-ci voted on patch set 5 V +1 09/02/26, 15:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107644

  17. Oliver Klee voted on patch set 5 V +1 09/02/26, 15:10

  18. Simon Schaufelberger voted on patch set 5 CR +1 V +1 09/02/26, 15:50

  19. Benni Mack voted on patch set 5 CR +2 V +2 09/02/26, 16:01

  20. Benni Mack merged patch set 6 09/02/26, 16:01