Review 14.3 Merged

95571[BUGFIX] Avoid endless recursion in workspace dependencies

Benni Mack CR +2 V +2 Hard +421 −16 updated 09/02/26, 17:13

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
  • Verified V +2 Done
    • Benni Mack +2
    • core-ci +1 CI

Issues 1

Files 5

Review log 34

  1. Benni Mack commented on patch set 1 09/02/26, 16:01

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 09/02/26, 16:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107650

  3. Benni Mack voted on patch set 1 CR +2 V +2 09/02/26, 17:13

  4. Benni Mack merged patch set 2 09/02/26, 17:13