Review 11.5 Abandoned

85927[TASK] Remove instance state from `ResourceFactory`

Stefan Bürk CR 0 V 0 Normal +95 −31 updated 09/23/24, 09:42

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 0
  • Verified V 0

Issues 1

Files 3

Review log 1216

  1. Stefan Bürk uploaded patch set 1 09/09/24, 14:03

  2. Stefan Bürk wrote 09/09/24, 14:04

    Removed reviewer Garvin Hicking.
  3. Stefan Bürk updated the commit message in patch set 2 09/09/24, 14:04

  4. Stefan Bürk uploaded patch set 3 09/09/24, 14:05

  5. Stefan Bürk uploaded patch set 4 09/09/24, 14:07

  6. core-ci voted on patch set 1 V -1 09/09/24, 14:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65097

  7. core-ci voted on patch set 4 V -1 09/09/24, 14:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65100

  8. Stefan Bürk uploaded patch set 5 V -1 09/09/24, 14:21

  9. core-ci voted on patch set 5 V +1 09/09/24, 14:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65101

  10. Benjamin Franzke commented on patch set 5 CR -1 09/09/24, 14:29

    Why backport to 11.5 (and not 12.4)? and why didn'nt you mention the targets here(?)
  11. Stefan Bürk commented on patch set 5 CR -2 09/09/24, 14:55

    Reply Unresolved

    not ment to get merged. Need the backport to create a composer patch for a project ;) will be abandonend afterwards.
  12. Stefan Bürk abandoned the change 09/09/24, 15:37

  13. Stefan Bürk restored the change 09/23/24, 09:23

  14. Stefan Bürk uploaded patch set 6 CR -1 V +1 09/23/24, 09:29

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  15. core-ci voted on patch set 6 V +1 09/23/24, 09:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66428

  16. Stefan Bürk abandoned the change 09/23/24, 09:42