Review main Merged

85775[TASK] Remove instance state from `ResourceFactory`

Stefan Bürk CR +2 V +2 Normal +84 −27 updated 08/28/24, 10:27

Commit message

Stateful services come with a lot of drawbacks
and needs to be avoided. The `ResourceFactory`
holds state in form of internal instance cache
properties, which cannot be cleared.

Clearing these cache states can be a vital task
in long running worker processes, migration tasks
or similar things.

In the current form, class instances retrieved
from the Symfony DI container are not set into
the internal GeneralUtility instance cache and
cannot be removed from it. Even if that would
be possible, the state would be hold in the DI
container due to the nature of being a shared
service.

This change modifies the `ResourceFactory` to
use the `core.runtime` transient cache instead,
which allows clearing the state if needed.

Note that removing `SingletonInterface` from
`ResourceFactory` is not yet possible and
needs some other changes first.

Review

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

Issues 1

Files 2

Review log 1317

  1. Stefan Bürk uploaded patch set 1 08/25/24, 17:39

  2. core-ci voted on patch set 1 V +1 08/25/24, 17:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64160

  3. Stefan Bürk voted on patch set 1 CR -1 08/27/24, 13:57

  4. Stefan Bürk uploaded patch set 2 CR -1 V +1 08/27/24, 14:34

  5. Stefan Bürk uploaded patch set 3 08/27/24, 14:35

  6. Stefan Bürk uploaded patch set 4 08/27/24, 14:39

  7. core-ci voted on patch set 4 V +1 08/27/24, 14:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64330

  8. Garvin Hicking voted on patch set 4 CR +1 V +1 08/27/24, 20:34

  9. Christian Kuhn commented on patch set 4 08/27/24, 21:56

    Stateful ;)
  10. Christian Kuhn updated the commit message in patch set 5 CR +1 V +1 08/27/24, 21:59

  11. Christian Kuhn updated the commit message in patch set 6 08/27/24, 22:00

  12. Christian Kuhn commented on patch set 6 CR +1 V +1 08/27/24, 22:00

    Reply

    Done
  13. core-ci voted on patch set 5 V +1 08/27/24, 22:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64366

  14. core-ci voted on patch set 6 V +1 08/27/24, 22:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64367

  15. Garvin Hicking voted on patch set 6 CR +1 V +1 08/28/24, 05:04

  16. Stefan Bürk voted on patch set 6 CR +2 V +2 08/28/24, 10:27

  17. Stefan Bürk merged patch set 7 08/28/24, 10:27