Review main Merged

89992[FEATURE] Allow install tool sessions without shared file system

Sven Liebert CR +2 V +2 Hard +234 −24 updated 10/21/25, 15:43

Commit message

This change introduces Redis session handling for the install tool and
additionally allows configuration of the session storage path
for file-based sessions.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Garvin Hicking +1
  • Verified V +2 Done
    • Benni Mack +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 6

Review log 5574

Show 3649 earlier messages
  1. Sven Liebert uploaded patch set 1 07/05/25, 15:46

  2. core-ci voted on patch set 1 V -1 07/05/25, 15:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81340

  3. Sven Liebert uploaded patch set 2 V -1 07/05/25, 15:55

  4. Sven Liebert uploaded patch set 3 07/05/25, 15:58

  5. core-ci voted on patch set 2 V -1 07/05/25, 16:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81341

  6. Sven Liebert uploaded patch set 4 07/05/25, 16:03

  7. Sven Liebert uploaded patch set 5 07/05/25, 16:05

  8. core-ci voted on patch set 3 V -1 07/05/25, 16:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81342

  9. core-ci voted on patch set 4 V -1 07/05/25, 16:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81343

  10. core-ci voted on patch set 5 V +1 07/05/25, 16:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81344

  11. Simon Schaufelberger commented on patch set 5 07/05/25, 19:40

    Features can't be backported. No 13.4 release. Additionally the commit message and changelog should be improved. The english is not really correct.
  12. Sven Liebert commented on patch set 5 07/05/25, 19:46

    Reply

    I will improve the english. Sorry. But this feature here is backported or was it before development of v14 started? https://forge.typo3.org/issues/105638
  13. Sven Liebert uploaded patch set 6 V +1 07/05/25, 19:48

  14. Sven Liebert commented on patch set 6 07/05/25, 19:48

    Reply

    Done including removing backporting for v13
  15. core-ci voted on patch set 6 V +1 07/05/25, 19:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81345

  16. Garvin Hicking commented on patch set 6 07/05/25, 20:30

    Reply

    Thanks for this patch, I think having this flexibility is a good thing to discuss. The mentioned issue was an exemption because it is/was very important to the adoption of Content-Blocks. Generally, Simon is right, and backporting features by default is not planned. In some cases exemptions need to be made, and is discussed by the merger team.
  17. Sven Liebert commented on patch set 6 07/05/25, 20:34

    Reply

    Yeah we have some real struggles with the current approach in kubernetes environment, so I looked that it‘s compatible with v13 without breaking stuff and hoped we can get it in v13, but if thats not possible, thats ok either. Thank you! :)
  18. Garvin Hicking commented on patch set 6 07/05/25, 21:21

    Reply

    For sure! Interested parties could include it as a composer patch. And the way you implemented it could allow future ofher session handlers too, thats a good foresight. In the install tool context and the reduced DI failsafe container env we probably can't use "cooler" ways of this via autotagging or service definitions. It's not my special area but let's see where this can go, thanks for the initiative to solve it. If I may ask (curiosity): Most instances I know that use horizontal scaling and redis-y clusters are so deployment-driven or set up in read-only containers with their setup that they don't utilize the install tool context (or even are now lacking Ext:install). Maybe you could describe your scenario where/how you use the install tool here, so that shared install tool sessions would be vital?
  19. Sven Liebert commented on patch set 6 07/06/25, 06:23

    Reply

    We have multiple CMS pods and we use the maintenance tool for flushing caches when needed or database comparing. The install tool itself we don‘t use in production context. But in my mind it is not a good solution to share files between pods, so is might be better to use redis or something to have a shared install tool session. And I‘m open for cooler implementation ways, if possible :) So don‘t hesitate to discuss that here :)
  20. Oliver Klee updated the commit message in patch set 7 V +1 07/06/25, 08:53

  21. core-ci voted on patch set 7 V +1 07/06/25, 09:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81361

  22. Andreas Kienast commented on patch set 7 07/07/25, 06:27

    We already have the Session Storage introduced with https://review.typo3.org/c/Packages/TYPO3.CMS/+/51549. Perhaps we can extend this approach for usage in the Install Tool?
  23. Andreas Kienast commented on patch set 7 07/07/25, 06:28

    Reply

    _unresolved..._
  24. Sven Liebert commented on patch set 7 07/07/25, 06:44

    Reply

    Maybe I just not understand the feature from there, but basically it's exactly that or isn't it? An interface (SessionBackendInterface) is defined there and then it could used from multiple backends. Here we have a PHP-defined interface for session handling, which is needed to be implemented. And then every implementation could used like in backend sessions. Maybe you can give me a short summary what you mean? :)
  25. Andreas Kienast commented on patch set 7 07/07/25, 07:07

    Reply

    The patch I've linked introduced a `RedisSessionBackend`, yours introduces another `RedisSessionHandler`. This looks like a different concept (I'm totally fine with streamlining this, I've never worked with `\SessionHandlerInterface`). Also, there's already the configuration path `SYS/session`, while this patch introduces `BE/installToolSession` for this.
  26. Sven Liebert commented on patch set 7 07/07/25, 07:12

    Reply

    Ah that makes it clear, thank you. I'm not sure wether we should use the existing RedisSessionBackend, because the install tool session works with PHP custom session handler today: https://www.php.net/manual/en/session.customhandler.php So for using redis here, I needed to implement `\SessionHandlerInterface)`. But you are right, we could add the configuration to `SYS\session`. Any thoughts about that from maybe @benni@typo3.org or @garvin@hick.ing ? :)
  27. Sven Liebert commented on patch set 7 07/07/25, 10:58

    I will add authentication possibility when it's clear where we want to configure that.
  28. Sven Liebert uploaded patch set 8 V +1 08/07/25, 19:07

  29. Sven Liebert commented on patch set 8 08/07/25, 19:08

    I add authentication and made it more failure proof. If something goes wrong with redis (unavailable or wrong configured) it fallbacks to file based session. I checked together with Benni to use Symfony RedisSessionHandler but it's not suitable for our purposes.
  30. core-ci voted on patch set 8 V -1 08/07/25, 19:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82878

  31. Sven Liebert uploaded patch set 9 V -1 08/07/25, 19:27

  32. core-ci voted on patch set 9 V +1 08/07/25, 19:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82884

  33. Sven Liebert commented on patch set 9 08/07/25, 19:37

    Reply

    Done
  34. Sven Liebert commented on patch set 9 08/07/25, 19:38

    Reply

    Discussed with Benni, that the place to configure is valid
  35. Sven Liebert commented on patch set 9 08/07/25, 19:38

    Reply

    Done
  36. Sven Liebert uploaded patch set 10 V +1 08/07/25, 20:00

  37. Sven Liebert uploaded patch set 11 08/07/25, 20:08

  38. Benni Mack commented on patch set 11 08/07/25, 20:08

    Feature-101059-AddRedisSessionHandlerInstallTool.rst:7

    use === until the end of the line.

    RedisSessionHandler.php:2

    use strict

    SessionService.php:72

    needs ?? '' - right?

    SessionService.php:74

    obsolete.

    SessionService.php:118

    let's use new in install tool context.
  39. core-ci voted on patch set 10 V +1 08/07/25, 20:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82906

  40. Benni Mack uploaded patch set 12 08/07/25, 20:21

  41. Sven Liebert commented on patch set 12 08/07/25, 20:22

    Feature-101059-AddRedisSessionHandlerInstallTool.rst:7 Reply

    Done

    RedisSessionHandler.php:2 Reply

    Done

    SessionService.php:72 Reply

    Done

    SessionService.php:74 Reply

    Done

    SessionService.php:118 Reply

    Done
  42. core-ci voted on patch set 11 V +1 08/07/25, 20:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82911

  43. Benni Mack uploaded patch set 13 08/07/25, 20:33

  44. Benni Mack voted on patch set 13 CR +1 V +1 08/07/25, 20:33

  45. Sven Liebert voted on patch set 13 CR +1 V +1 08/07/25, 20:34

  46. core-ci voted on patch set 12 V -1 08/07/25, 20:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82917

  47. Elias Häußler commented on patch set 13 08/07/25, 21:00

    RedisSessionHandler.php:22

    Can we make this class `final`, since all relevant properties are already `private` and therefore inaccessible in child classes?

    SessionService.php:69

    An additional check if `$sessionHandlerClass` implements `\SessionHandlerInterface` would be nice to avoid errors here.
  48. core-ci voted on patch set 13 V -1 08/07/25, 21:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82923

  49. Sven Liebert uploaded patch set 14 CR +1 V +1 08/07/25, 21:05

  1. Sven Liebert commented on patch set 14 CR +1 V +1 08/07/25, 21:05

    RedisSessionHandler.php:22 Reply

    Done

    SessionService.php:69 Reply

    I think it's not useful here because we silently fail on any error
  2. core-ci voted on patch set 14 V -1 08/07/25, 21:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82934

  3. Sven Liebert uploaded patch set 15 CR +1 V +1 08/07/25, 21:23

  4. Andreas Wolf commented on patch set 14 08/07/25, 21:26

    RedisSessionHandler.php:35

    This could also be annotated on the method: ``` /** * @param array{user?: string, pass?: string} $authentication */ ```

    RedisSessionHandler.php:65

    I guess this is a no-op because Redis handles expiry automatically? Might be good to add a comment stating that here.

    RedisSessionHandler.php:81

    According to the PHP docs, this should return `false` if the record was not found: https://www.php.net/manual/en/sessionhandlerinterface.read.php

    SessionService.php:70

    Shouldn't this at least log something or somehow indicate that this is only the fallback? I can imagine that this will create hard to catch errors otherwise…
  5. Sven Liebert uploaded patch set 16 08/07/25, 21:30

  6. core-ci voted on patch set 15 V +1 08/07/25, 21:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82939

  7. Sven Liebert commented on patch set 16 08/07/25, 21:33

    RedisSessionHandler.php:35 Reply

    Done

    RedisSessionHandler.php:65 Reply

    Done

    RedisSessionHandler.php:81 Reply

    Leads to error like it's used from SessionService. You can recheck the FileSessionHandler. There is return also always an empty string.

    SessionService.php:70 Reply

    There is no logging inside the install tool session handling at all. I think it's not necessary to log here.
  8. core-ci voted on patch set 16 V +1 08/07/25, 21:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82942

  9. Sven Liebert uploaded patch set 17 V +1 08/07/25, 21:42

  10. Sven Liebert commented on patch set 16 08/07/25, 21:42

    SessionService.php:70 Reply

    Implemented logging here. Thought about it. I think you are right!
  11. Sven Liebert uploaded patch set 18 08/07/25, 21:45

  12. Sven Liebert commented on patch set 18 08/07/25, 21:45

    RedisSessionHandler.php:81 Reply

    Added comment to clarify
  13. Sven Liebert uploaded patch set 19 08/07/25, 21:47

  14. core-ci voted on patch set 17 V -1 08/07/25, 21:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82946

  15. Andreas Wolf commented on patch set 19 CR +1 08/07/25, 21:57

    RedisSessionHandler.php:35 Reply

    This comment can go now IMO.
  16. Sven Liebert uploaded patch set 20 CR +1 08/07/25, 21:58

  17. Sven Liebert commented on patch set 19 08/07/25, 21:58

    RedisSessionHandler.php:35 Reply

    Done
  18. core-ci voted on patch set 19 V +1 08/07/25, 22:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82954

  19. core-ci voted on patch set 20 V +1 08/07/25, 22:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82956

  20. Garvin Hicking voted on patch set 20 CR +1 V +1 08/07/25, 22:19

  21. Benni Mack commented on patch set 20 CR +2 V +2 08/08/25, 07:46

    works now (even in v13 :))
  22. Benni Mack merged patch set 21 08/08/25, 07:46

  23. Benjamin Franzke commented on patch set 21 09/17/25, 06:59

    Feature-101059-AddRedisSessionHandlerInstallTool.rst:47

    Hey, Were you able to test this example as configured directly in `system/settings.php`. I guess you tested via additional.php but there is actually a fine difference in this case. I just stumbled over this while thinking about change the defaults to be static: > 90698: [WIP][TASK] Use a static default for the install tool session path | https://review.typo3.org/c/Packages/TYPO3.CMS/+/90698 There is a problem with how system settings from `config/system/settings.php` are merged with default configuration, which means that this example combined with the current default configuration will result in an actualy configuration like: ``` installToolSessionHandler className = TYPO3\CMS\Install\Service\Session\RedisSessionHandler options authentication pass = redis user = redis database = 0 host = 127.0.0.1 port = 6379 sessionPath = /var/www/…/session ``` You see that `$sessionPath` is added because it is configured in DefaultConfiguration.php which ultimately resolves in a constructor error which is (thankfully!) logged as: ``` Wed, 17 Sep 2025 08:51:33 +0200 [ERROR] request="bb869bc0ecc7a" component="TYPO3.CMS.Install.Service.SessionService": Session handler is not configured properly: Unknown named parameter $sessionPath ``` I just want to mention this problem here for now. I don't know yet how to solve this properly as I'm not sure it is a good idea to pass the configuration as plain constructor arguments in https://review.typo3.org/c/Packages/TYPO3.CMS/+/89992/21/typo3/sysext/install/Classes/Service/SessionService.php#69 I see two options: * Define factories instead of implying a 1:1 option-to-constructor-argument transformation * Remove the default options and let the file session handler resolve them on it's own
  24. Benjamin Franzke commented on patch set 21 09/17/25, 07:04

    Feature-101059-AddRedisSessionHandlerInstallTool.rst:47 Reply

    Moved this into an issue so we can track this easier: https://forge.typo3.org/issues/107466
  25. Sven Liebert commented on patch set 21 10/21/25, 15:43

    Feature-101059-AddRedisSessionHandlerInstallTool.rst:47 Reply

    Fixed in follow up