-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support connection retries for Redis session and compatible with colinmollenhour/php-redis-session-abstract v2.0.0 #38729
Support connection retries for Redis session and compatible with colinmollenhour/php-redis-session-abstract v2.0.0 #38729
Conversation
Hi @TuVanDev. Thank you for your contribution! Add the comment under your pull request to deploy test or vanilla Magento instance:
❗ Automated tests can be triggered manually with an appropriate comment:
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@magento run all tests |
Hmm, let's hold on a bit and see what the response is from colinmollenhour/php-redis-session-abstract#58, I'm pretty sure the change will be reverted, maybe they'll release a 2.0.0 with this change, and then we can implement this fix ... |
I have been facing the same issue recently on my site when I updated her composer then I started getting this error while running the compilation command. |
So, since version 1.7.0 of
Update: maybe you can also change the description of this PR? @TuVanDev: could you do this? Thanks! |
Thanks @hostep I've updated the To the maintainers: Since the |
Thanks @TuVanDev, can you also update the title of the PR with the correct version? And maybe remove the patch instructions from the description, it's not longer relevant as a quick fix now that v1.7 is out. Thank you! |
@magento run all tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @TuVanDev,
Thanks for the collaboration!
Please check the below review comment and also the automated tests failures. It seems the failures are due to code changes, mainly static test failures.
Thanks
/** | ||
* @inheritdoc | ||
*/ | ||
public function getRetries() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the return type for this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @engcom-Alfa , this method is similar to other methods in the Config class. If we add the return type to this method, we should also add the return types to other methods for code consistency.
/**
* @inheritdoc
*/
public function getPassword()
{
return $this->deploymentConfig->get(self::PARAM_PASSWORD);
}
/**
* @inheritdoc
*/
public function getTimeout()
{
return $this->deploymentConfig->get(self::PARAM_TIMEOUT);
}
/**
* @inheritdoc
*/
public function getRetries()
{
return $this->deploymentConfig->get(self::PARAM_RETRIES);
}
I understand that the changes in this pull request may result in failed tests, as the classes Magento\Framework\Session\SaveHandler\Redis\Config
and Magento\Setup\Model\ConfigOptionsList\Session
have not been updated for years. Unfortunately, I don't currently have the time to address this issue, so I would greatly appreciate it if someone could assist me with resolving it.
@hostep I've updated the title to match the new version of Thanks for suggestions. |
Hello @TuVanDev, Please resolve the conflicts of this PR, so that we can move further with this. Meanwhile marking this PR as draft. Thanks |
Hello, Internal Team will pick this PR sooner and will work on the failures and ensure the compatibility of library with latest version. Thanks. |
e416abc
into
magento:2.4-develop
This pull request is intended to resolve compatibility issues with
colinmollenhour/php-redis-session-abstract
v1.6.0 and to support connection retries for Redis sessions, which were introduced in v1.6.0 ofcolinmollenhour/php-redis-session-abstract
. However, sincecolinmollenhour/php-redis-session-abstract
reverted the changes in v1.7.0, the compatibility issue no longer exists. Furthermore,colinmollenhour/php-redis-session-abstract
has also released version v2.0.0, which is identical to 1.6.0. Therefore, the changes in this pull request now remain to support connection retries for Redis sessions, as introduced in v2.0.0 ofcolinmollenhour/php-redis-session-abstract
.Description (*)
The newest version of Cm RedisSession, version v2.0.0 has introduced support connection retries. This pull request intends to implement it in the Magento codebase.
The changes made in this pull request include:
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Patches
Until the issue is resolved in the next Magento version, you can apply the two patches I have prepared:
magento/framework
package:File name:
magento-magento2-base_GitHub-PR-38729-compatible-with-collinmollenhour-redis-session-v1.6.0.patch
magento/magento2-base
package:File name:
magento-magento2-framework_GitHub-PR-38729-compatible-with-collinmollenhour-redis-session-v2.0.0.patch
To apply patches for Magento Open Source and Adobe Commerce, please refer to the following documentation:
The configuration for applying the two patches using the
cweagans/composer-patches
composer patch plugin to address this issue should look like the following:Feature information
If this pull request is accepted, you will be able to configure the number of retries for the Redis connection in the app/etc/env.php file, under the session section:
Contribution checklist (*)