PR-4.4-dev Pending

User tests: Successful: Unsuccessful:

avatar yossibeck
yossibeck
29 Jun 2024

since the same redis can be used for cache + session (or other stuff) only keys that match the -cache- should be used

Pull Request for Issue #43718

Summary of Changes

this code would delete ALL keys that aren't in a group regardless of being a cache or not
e.g. deleting keys that handle session or any other stuff

            if (strpos($key, $secret . self::CACHE_KEY . $group . '-') !== 0 && $mode !== 'group') {
                static::$_redis->del($key);

the code
static::$_redis->keys('*' . self::CACHE_KEY . '*');
instead of
static::$_redis->keys('*');
makes sure redis cache ONLY handles cache keys

Testing Instructions

  1. setup a redis server
  2. define that server as a cache_handler + session_handler
  3. use the same server for redis_server_host + session_redis_server_host
  4. start caching stuff - and login
    on the first delete of a non group cache - you'll lose all of your sessions
    the easiest way to do that is to connect to redis with
redis-cli -h <host name>
HOST-NAME:PORT>monitor

and you'll see after a while these commands:

HOST-NAME:PORT>KEYS "*"
HOST-NAME:PORT>DEL <session-id 1>
HOST-NAME:PORT>DEL <session-id 2>
HOST-NAME:PORT>DEL <session-id 3>
....

Actual result BEFORE applying this Pull Request

seeing the

HOST-NAME:PORT>KEYS "*"
HOST-NAME:PORT>DEL <session-id 1>
HOST-NAME:PORT>DEL <session-id 2>
HOST-NAME:PORT>DEL <session-id 3>
....

Expected result AFTER applying this Pull Request

not seeing

HOST-NAME:PORT>KEYS "*"
HOST-NAME:PORT>DEL <session-id 1>
HOST-NAME:PORT>DEL <session-id 2>
HOST-NAME:PORT>DEL <session-id 3>
....

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar yossibeck yossibeck - open - 29 Jun 2024
avatar yossibeck yossibeck - change - 29 Jun 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 29 Jun 2024
Category Libraries
avatar yossibeck yossibeck - change - 29 Jun 2024
Labels Added: PR-4.4-dev
avatar HLeithner
HLeithner - comment - 15 Nov 2024

This pull request has been automatically rebased to 5.3-dev.

avatar yossibeck
yossibeck - comment - 19 Nov 2024

do I need to do anything in order for this to be approved / merged ?

avatar richard67
richard67 - comment - 19 Nov 2024

do I need to do anything in order for this to be approved / merged ?

Like every PR, this needs 2 successful human tests before it can be set to RTC (ready to commit) and then be merged.

Test results have to be reported on the issue tracker https://issues.joomla.org/tracker/joomla-cms/43719 by using the blue "Test this" button.

Ah, and the author should not be one of the 2 testers as the author should already have tested their fix before proposing it.

Add a Comment

Login with GitHub to post a comment