Review main Merged

93048[BUGFIX] Add error handling for Redis commands in RedisSessionBackend

Rico Sonntag CR +2 V +2 Normal +171 −5 updated 09/16/26, 13:27

Commit message

The collectGarbage() method silently discards del() failures
when removing expired sessions. If del() returns false (e.g. due
to permission errors or connection issues), the failure goes
unnoticed.

Add a logRedisCommandFailure() helper method (consistent with
RedisBackend) and check del() return values in collectGarbage(),
logging a warning on failure.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oliver Klee +1
    • Markus Klein +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oliver Klee +1
    • Markus Klein +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 2328

Show 3 earlier messages
  1. Rico Sonntag uploaded patch set 1 03/03/26, 19:46

  2. Rico Sonntag updated the commit message in patch set 2 03/03/26, 19:46

  3. Rico Sonntag commented on patch set 2 03/03/26, 19:46

    Follow-up to https://review.typo3.org/c/Packages/TYPO3.CMS/+/93013 — applies the same error handling pattern (logRedisCommandFailure) to RedisSessionBackend as suggested by Markus Klein.
  1. core-ci voted on patch set 1 V +1 03/03/26, 19:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97219

  2. core-ci voted on patch set 2 V +1 03/03/26, 19:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97220

  3. Markus Klein voted on patch set 2 CR +1 V +1 03/09/26, 08:53

  4. Markus Klein commented on patch set 2 CR 0 V 0 03/09/26, 08:54

    RedisSessionBackendTest.php:28

    why removing this?
  5. Rico Sonntag commented on patch set 2 03/09/26, 16:03

    RedisSessionBackendTest.php Reply

    Both checks effectively verify the same thing — whether phpredis is available. #[RequiresPhpExtension("redis")] internally uses extension_loaded("redis") (in PHPUnit's Requirements.php), while the removed code used class_exists(\Redis::class). Since the \Redis class is exclusively provided by the redis PHP extension, these are functionally equivalent. The attribute is the modern, declarative replacement and already used in the functional variant of this test class.
  6. Rico Sonntag commented on patch set 2 03/09/26, 16:08

    RedisSessionBackendTest.php Reply

    Done
  7. Rico Sonntag commented on patch set 2 03/10/26, 07:00

    RedisSessionBackendTest.php:28 Reply

    Both checks effectively verify the same thing — whether phpredis is available. #[RequiresPhpExtension("redis")] internally uses extension_loaded("redis") (in PHPUnit's Requirements.php), while the removed code used class_exists(\Redis::class). Since the \Redis class is exclusively provided by the redis PHP extension, these are functionally equivalent. The attribute is the modern, declarative replacement and already used in the functional variant of this test class.
  8. Markus Klein commented on patch set 2 CR +1 V +1 03/10/26, 11:22

    RedisSessionBackendTest.php:28 Reply

    Oh, sorry. I overlooked the [RequiresPhpExtension('redis')] attribute. Thx.
  9. Sven Liebert voted on patch set 2 CR +1 V +1 03/10/26, 14:13

  10. Benni Mack updated the commit message in patch set 3 CR +1 V +1 04/22/26, 07:14

  11. core-ci voted on patch set 3 V -1 04/22/26, 12:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100848

  12. Benni Mack uploaded patch set 4 V -1 09/04/26, 07:34

  13. core-ci voted on patch set 4 V +1 09/04/26, 07:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107819

  14. Oliver Klee voted on patch set 4 CR +1 V +1 09/04/26, 09:58

  15. Markus Klein voted on patch set 4 CR +1 V +1 09/06/26, 19:22

  16. Simon Schaufelberger commented on patch set 4 CR -1 09/06/26, 19:29

    RedisSessionBackendTest.php:191

    import namespace
  17. Benni Mack uploaded patch set 5 CR +1 V +1 09/16/26, 10:25

  18. Benni Mack commented on patch set 5 09/16/26, 10:27

    RedisSessionBackendTest.php:191 Reply

    Done
  19. core-ci voted on patch set 5 V +1 09/16/26, 10:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108672

  20. Benni Mack voted on patch set 5 CR +1 09/16/26, 10:49

  21. Oliver Klee voted on patch set 5 CR +1 V +1 09/16/26, 10:49

  22. Markus Klein voted on patch set 5 CR +1 V +1 09/16/26, 13:04

  23. Benni Mack voted on patch set 5 CR +2 09/16/26, 13:27

  24. Benni Mack voted on patch set 5 V +2 09/16/26, 13:27

  25. Benni Mack merged patch set 6 09/16/26, 13:27