60718[BUGFIX] Reload Cache configuration after installing an extension
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 1
Review log 79
-
Stefan Froemken uploaded patch set 1 05/08/19, 07:42
-
TYPO3com voted on patch set 1 V +1 05/08/19, 07:59 Completed build in 16m 50s on Wed, 8 May, 09:59 AM Test Summary: 47670 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33780
-
Benjamin Franzke uploaded patch set 2 05/08/19, 09:38
-
Benjamin Franzke commented on patch set 1 05/08/19, 09:39
Up front: In v9 we deprecated CacheManager usage during ext_localconf/BaseTCA loading. What is the purpose to use a cache for the TCA generation (which can be cached by using Configuration/TCA itself)? I assume the usecase is ext_tables.php (or some hook?) We have kind of a greyzone here.. CacheManager usage is disallowed (deprecated in v9) during BaseTCA load (Configuration/TCA/*), but not explicitly forbidden in ext_tables.php (yet), simply because that isn't loaded by Bootstrap, but by the (Backend)Application. Regarding the fix itself: This will help for newly added cache configurations – but what about cache configurations that may have been *changed* by the to-be-installed extension's ext_localconf.php(?) Configuration changes would not be reloaded by setCacheConfiguration() – the existing cache instances (with the previous configuration) would be used. Note: that applies to all cache configurations as CacheManger::flushCaches() is called prior to reloadCaches() which implicitly instanciates all caches. I see two options: 1) Create a new CacheManager instance and overwrite the singleton in GeneralUtility 2) Add a method to CacheManager to prune existing instances, in order to respect the new configuration. I'm still trying to figure out which one is the better one. I somewhat tend to option 1). Although that leaves existing CacheManager instance references with the old (configuration/instance) state, that allows us to run both instances in parallel (in future). In threory I'd like to see a sandbox for loading the new state for the new extension (but ext_localconf.php is an antipattern with it's global state in this regard), so that'll only be possible with a replacement for ext_localconf.php, anyway, step 1) is a step into that direction. I've uploaded patchset 2. Can you check whether that fixes your problem as well? (didn't have time to test that yet). I would be interested in your exact usecase (which hook/TCA file you are trying to use the CacheManager in). -
TYPO3com voted on patch set 2 V +1 05/08/19, 09:52 Completed build in 14m 14s on Wed, 8 May, 11:52 AM Test Summary: 47670 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33783
-
Stefan Froemken commented on patch set 2 05/08/19, 13:22
I need something similar to CategoryRegistry. For our maps2 extension I have build a registry to create SQL column and TCA for foreign extensions which want to relate their records to maps2: https://github.com/jweiland-net/maps2/blob/master/Classes/Tca/Maps2Registry.php The problem is, that CategoryRegistry has a special implementation in TYPO3 which I can't use. I have forget to add method flushCachesInGroup() in my patch. This call will recreate all existing caches. For now I have a solution in my own extension (see link above), but would be cool to have that in Core. I don't think that your patch will work as you have moved CacheManager AFTER loadBaseTCA. Everywhere else in Core you're loading CacheManager just after ext_localconf and before loadBaseTCA. As my Registry will be loaded from within an Overrides/* file your new patch will fail. -
Benjamin Franzke commented on patch set 2 05/08/19, 14:24
> I don't think that your patch will work as you have moved CacheManager AFTER loadBaseTCA. Everywhere else in Core you're loading CacheManager just after ext_localconf and before loadBaseTCA. No, since https://review.typo3.org/c/Packages/TYPO3.CMS/+/59231 (git master only) we load it afterwards. That was possible due to the deprecation of CacheManager usage in ext_localconf in v9: https://review.typo3.org/c/Packages/TYPO3.CMS/+/58371 That's why I said this may be problematic as the usage you are trying to do is deprecated. (short info what the motivation for that deprecation is: CacheManager is in a limbo state during ext_localconf load and there were several bugs where caches where initialized before they have been fulled configured and so on.) But yea, for the v9 backport we would need to move it before the loadBaseTca call, to match the v9 bootstrap. Thanks to the link to your extension, I'll check the usecase and especially how that's compatible with the upcoming v10. -
Stefan Froemken commented on patch set 2 03/10/20, 12:09
I have just tested this issue against TYPO3 10.3. I can not reproduce the problem. The CacheManager always knows all CacheConfiguration. So IMO there is no need to patch anything anymore. -
Georg Ringer abandoned the change 03/10/20, 12:15