Skip to content
Snippets Groups Projects
Commit 2aeff134 authored by Stefan Bürk's avatar Stefan Bürk
Browse files

[TASK] Remove instance state from `ResourceFactory`

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.

Resolves: #104728
Releases: main
Change-Id: I6a632722ae3b3e28c0cf53301f9d8f0b2c103c4f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85775


Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarGarvin Hicking <gh@faktor-e.de>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarGarvin Hicking <gh@faktor-e.de>
parent e91c894a
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment