63027[FEATURE] Introduce Cache Clear Command
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 2
Review log 1215
-
Kevin Appelt uploaded patch set 1 01/24/20, 19:47
-
TYPO3com voted on patch set 1 V +1 01/24/20, 19:56 Completed build in 09m 28s on Fri, 24 Jan, 07:56 PM Test Summary: 70581 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40203
-
Alexander Schnitzler commented on patch set 1 CR -1 01/25/20, 10:02
Implementing a command to clear the cache is a good thing. Very much needed nowadays. What I think is that your implementation is still quite basic and not the most user friendly. What I would like to see is a command as in symfony, that by default flushes all caches. Because at the moment that command is most needed. Further, I'd like to have a more sophisticated command in the future or a support command that let's you list all available caches to not let the users have to browse the source code to find possible cache identifiers. Furthermore, if we pass the identifier directly to the data handler, we have an invisible bond of the command and the data handler, or the identifiers it accepts. People might look at the code, reverse engineer possible identifiers, use them and then all changes to the data handler are possibly breaking for some users. The command must define and validate its possible arguments and options and act accordingly to deliver a good api. Hence, it's easiest to start with a simple cache:clear command without options and arguments which flushes the whole cache. Last but not least I don't think that using the data handler is the best of ideas here. TYPO3 has a caching framework and this could and should be spoken to directly imho. That way we don't interfere with how the data handler works and keep the complexity as is instead of increasing it. -
Kevin Appelt commented on patch set 1 CR -1 01/25/20, 13:38
> Patch Set 1: Code-Review-1 > > Implementing a command to clear the cache is a good thing. Very much needed nowadays. > What I think is that your implementation is still quite basic and not the most user friendly. > > What I would like to see is a command as in symfony, that by default flushes all caches. Because at the moment that command is most needed. Further, I'd like to have a more sophisticated command in the future or a support command that let's you list all available caches to not let the users have to browse the source code to find possible cache identifiers. > > Furthermore, if we pass the identifier directly to the data handler, we have an invisible bond of the command and the data handler, or the identifiers it accepts. People might look at the code, reverse engineer possible identifiers, use them and then all changes to the data handler are possibly breaking for some users. > > The command must define and validate its possible arguments and options and act accordingly to deliver a good api. Hence, it's easiest to start with a simple cache:clear command without options and arguments which flushes the whole cache. > > Last but not least I don't think that using the data handler is the best of ideas here. TYPO3 has a caching framework and this could and should be spoken to directly imho. That way we don't interfere with how the data handler works and keep the complexity as is instead of increasing it. I thought it would be a good idea to use the existing method - but now I also see the disadvantages you mentioned. I'm trying to release a new version tonight that clears all caches via caching framework without using the data handler. -
Susi Moog commented on patch set 1 01/25/20, 15:13
> Patch Set 1: Code-Review-1 > I thought it would be a good idea to use the existing method - but now I also see the disadvantages you mentioned. > I'm trying to release a new version tonight that clears all caches via caching framework without using the data handler. Maybe check how the install tool does it, I fear introducing a third way to do the same thing would also not be helpful. -
Kevin Appelt uploaded patch set 2 01/25/20, 18:25
-
Kevin Appelt commented on patch set 2 01/25/20, 18:30
> Patch Set 1: > > > Patch Set 1: Code-Review-1 > > I thought it would be a good idea to use the existing method - but now I also see the disadvantages you mentioned. > > I'm trying to release a new version tonight that clears all caches via caching framework without using the data handler. > > Maybe check how the install tool does it, I fear introducing a third way to do the same thing would also not be helpful. Good point - I used it as stating point for patch set 2. -
TYPO3com voted on patch set 2 V -1 01/25/20, 18:34 Completed build in 08m 34s on Sat, 25 Jan, 06:34 PM Test Summary: 70280 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40234
-
TYPO3com voted on patch set 2 V +1 01/25/20, 18:48 Completed build in 08m 56s on Sat, 25 Jan, 06:48 PM Test Summary: 70582 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40235
-
Helmut Hummel commented on patch set 2 V -1 CR -1 01/25/20, 20:20
I understand the desire to have such thing in the core. However it isn’t as simple as it might look like, because commands currently do a full bootstrap, thus fail hard when this booting fails, e.g. because of corrupt caches. See the chicken egg problem here? This can be solved, but for that we need low level commands that don’t do a full boot first. Until this happened, I propose to postpone any efforts in creating a cache flush command. -
Kevin Appelt commented on patch set 2 01/27/20, 07:19
> Patch Set 2: Verified-1 Code-Review-1 > > I understand the desire to have such thing in the core. However it isn’t as simple as it might look like, because commands currently do a full bootstrap, thus fail hard when this booting fails, e.g. because of corrupt caches. > > See the chicken egg problem here? > This can be solved, but for that we need low level commands that don’t do a full boot first. > > Until this happened, I propose to postpone any efforts in creating a cache flush command. In my opinion it is better to have the command, even if it fails under some conditions, than not offering the possibility to empty the cache via CLI at all. How do the other reviewers see this? -
Alexander Schnitzler commented on patch set 2 01/27/20, 08:43
> Patch Set 2: > > > Patch Set 2: Verified-1 Code-Review-1 > > > > I understand the desire to have such thing in the core. However it isn’t as simple as it might look like, because commands currently do a full bootstrap, thus fail hard when this booting fails, e.g. because of corrupt caches. > > > > See the chicken egg problem here? > > This can be solved, but for that we need low level commands that don’t do a full boot first. > > > > Until this happened, I propose to postpone any efforts in creating a cache flush command. > > In my opinion it is better to have the command, even if it fails under some conditions, than not offering the possibility to empty the cache via CLI at all. > How do the other reviewers see this? I second that. As much as I understand that we have issues implementing such a command properly, we cannot continue to just describe dead ends and then letting patches disappear until the next unaware person creates the next one. @Helmut: You have a point here and as you had massive troubles implementing a clear cache command in your console extension I take your concerns seriously. But when blocking this patch with a -1, I'd like you to provide more information regarding the issues that await Kevin, implementing this properly. Do we have a summary of those issues? Do we know how a clear path to the solution looks like? Where do we stand? Who is working on this and what work has been done in the past? All this information is crucial to not stun us all. @Kevin: I know that Benjamin Franzke is also into this topic as he implemented the dependency injection, which relies heavily on caching and the possibility to warm up those caches. I fear that your approach is not the solution the project needs but I would like to encourage you to take this as a challenge and try to come up with a better solution. Yes, this work is not picking the cherry off the cake but that's seldomly the case in TYPO3. ^^ I know you are already part of an initiative and I guess you have a lot of work already but maybe you are the right guy nonetheless to start a new initiative dealing with the caching. I would like to see someone tightening the loose ends, bringing issues and developers together for a greater good. -
Benni Mack commented on patch set 2 01/27/20, 09:28
I agree, the "chicken egg" problem - we've had countless discussions on that, and the main reason was (until now) that Core bootstrap was dependent of the cache without having a better approach. A first step into this direction is to: a) not use core cache for package management b) not use core cache for DI (= it is part of the "build" phase) c) limit the definition of caches in DI and LocalConfiguration/AdditionalConfiguration (= breaking?) Open questions are: - How to deal with things like: I install an extension ships ships a cache which resides in the DB, but the DB tables have not been created yet? Or validating endpoints like memcached? This is always a "build phase" step, but the services are usually only valid after deployment. Installation of an extension does some heavy magic on re-loading PackageStates, Caches, ext_localconf etc. This is super-ugly. How to achieve "Lets change our package list during runtime" problem? Same goes btw. for composer plugins when a plugin is installed or uninstalled during a composer install command, but on a different level. -
Benni Mack commented on patch set 2 01/27/20, 09:29
For the first step "a)" - PackageManager without cache, I have a PoC in my stash after a discussion with Helmut, so this should be possible in v10. -
Benni Mack abandoned the change 02/27/20, 12:58
no plans for this way currently