#107167Unable to use the default redis database #0 for the session cache
Description
Since #104451 has been implemented, we can use the same redis database for all caches using prefixes.
Since redis doesn’t support databases on multi-core redis server, I was going to use the default database 0 with prefixes for all caches.
https://docs.typo3.org/permalink/t3coreapi:caching-backend-redis-example
It works except for the session cache :
cms-core/Classes/Session/Backend/RedisSessionBackend.php
function validateConfiguration() permits that :
if ($this->configuration['database'] < 0) {
throw new \InvalidArgumentException(
'The specified database "' . $this->configuration['database'] . '" must be greater or equal than zero.',
1481270923
);
}
but later,
function initializeConnection()
if (isset($this->configuration['database'])
&& $this->configuration['database'] > 0
&& !$this->redis->select($this->configuration['database'])
) {
throw new \RuntimeException(
'The given database "' . $this->configuration['database'] . '" could not be selected.',
1481270987
);
}
is there some logic I didn’t understood or is it a forgotten edge case ? ( > 0 instead of >= 0 )
Reviews 3
Related issues 2
History 710
-
Georg Ringer changed Related to #104451 <span data-processor="relativetime" data-value="2025-07-30T07:44:58+00:00" > 07/30/25, 07:44 </span>
-
Markus Klein changed Related to #70316 <span data-processor="relativetime" data-value="2025-07-30T11:53:04+00:00" > 07/30/25, 11:53 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 90200 status
NewUnder Review <span data-processor="relativetime" data-value="2025-07-30T12:00:01+00:00" > 07/30/25, 12:00 </span> -
Markus Klein commented and changed category assigned to Markus Klein priority
Should haveMust have Complexity trivial <span data-processor="relativetime" data-value="2025-07-30T12:02:38+00:00" > 07/30/25, 12:02 </span>@nalmar please review the patch above and vote. Thank you.
-
Rémi Payette commented <span data-processor="relativetime" data-value="2025-07-30T15:32:42+00:00" > 07/30/25, 15:32 </span>
@liayn I’m new to Gerrit but I think I did what you asked
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 90228 <span data-processor="relativetime" data-value="2025-08-04T07:16:38+00:00" > 08/04/25, 07:16 </span>
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 90229 <span data-processor="relativetime" data-value="2025-08-04T07:16:44+00:00" > 08/04/25, 07:16 </span>
-
Markus Klein commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-08-04T07:20:08+00:00" > 08/04/25, 07:20 </span>Applied in changeset commit:e1e0ce8e3059d1910dd6f3ed8443c27b6c6d12d1.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T13:58:04+00:00" > 12/02/25, 13:58 </span>
This bug obviously dates back to the original feature.