-
Notifications
You must be signed in to change notification settings - Fork 68
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
fix: Fixes assumption that CACHE_PORT & CACHE_PASSWORD are Set. #360
fix: Fixes assumption that CACHE_PORT & CACHE_PASSWORD are Set. #360
Conversation
timnolte
commented
Jun 24, 2022
•
edited
Loading
edited
- Fixes Blank Password Causing WP-CLI Failures, w/ PHP 8? #359
- Falls back on port 6379 if the CACHE_PORT is not configured.
- Doesn't require a CACHE_PASSWORD to be set when it isn't used, or can't be.
- Improves code quality by reducing Redis default port & databasei duplicate values to a share variables.
- Fixes invalid code changes made in PR #400 to the core plugin connectivity testing that prevent connectivty checks if the port/password/database aren't explicitly defined.
@danielbachhuber it is not clear to me why these tests have failed. I'm not seeing which tests I may need to update to account for this change. |
@timnolte: Thanks for this PR! |
a884f66
to
a9bead9
Compare
@strarsis so I attempted to add an option to increase the memory during testing but I don't think CircleCI will run the configuration changes in my branch. I'm also seeing an authentication error in the CircleCI build output. |
@timnolte: The modifications for increasing the memory limit seem to cause issues, some shell thing:
|
Well, given that the 255 error was already happening I didn't see that. I took the route of might need to use sudo just in case as documented by the CircleCI Support. https://support.circleci.com/hc/en-us/articles/360040700954-Increasing-PHP-s-memory-limit I can try it without |
@timnolte: This CI stuff is very annoying as testing it locally is not always possible or easily possible. |
a9bead9
to
7df1924
Compare
This approach changes the memory limit directly for PHP unit using the PHP unit CLI instead, this may be easier: |
@strarsis I tried without
|
@timnolte:
So 1GB or more can ensure there is enough memory during the test run: |
7df1924
to
e871953
Compare
Now there are other errors (a good thing?):
Shouldn't this be already handled by the test setup?
Those |
@strarsis I saw those same errors and I have no idea what to do about them. The authorization issue is for terminus and I'm pretty sure it's because there is no access to the keys within CircleCI for them to run successfully for my branch. GitHub Actions and other CI/CD platforms have the same problems. |
@greg-1-anderson @danielbachhuber @kporras07 just trying to get some eyes on this in light of PHP 8 compatibility and this causing a bunch of warnings/errors when no password is used. |
e871953
to
5eccb44
Compare
Just pinging this again. |
@timnolte We have an open issue that we are tracking internally (CMS-1119) for PHP 8.x support for the wp-redis plugin. The issue has been story pointed and is ready to bring into a sprint is not part of our current sprint. I have added this PR to our internal ticket to ensure that this gets eyes on it when we are working that ticket. |
@timnolte Thanks for your contribution. FWIW we've fixed the tests and included this in the We've also made some adjustments to our workflow to better work with automated deployments to wp.org. See CONTRIBUTING.md. Could you make this PR against |
I hadn't had a chance to get back to this but I will try to carve out some time to update my branch so that this can be officially fixed. We've been patching the plugin via composer for awhile now. |
@timnolte: Awesome, thank you! |
7be9fc3
to
2b5e0c5
Compare
00a520c
to
cf4ba56
Compare
@jazzsequence I've completely redone this work. I've already recreated my patch that I'm pushing out to our own projects via Composer patching. |
For those that need an immediate patch, that can be applied via Composer, for these changes you can get it here: https://gist.github.com/timnolte/267e2a502f05156c0fe2a0d7028c2854 |
actually, going to port these changes into #428 so automated testing can still run (since those don't work on PRs from outside contributors). |
Hmm, that's rather disappointing that outside contributors won't get any credit for their work. :-( |
Yeah, not sure what the issue is exactly, but we'll add you to the release props. |
you know what? if it's passing in #428 then I'm gonna just close that and use this instead. Just wanna pull in my changelog update and then will approve & merge. |
typo
not a typo 😬
@jazzsequence FYI, so something that is interesting is that I'm finding now that this change somehow doesn't work on Pantheon yet is working on non-Pantheon Redis environments. I'm working on testing this out further to see what the issue is on Pantheon vs non-Pantheon platforms. |
@timnolte To clarify, do you mean that it's not resolving the original issue, or that it actively causes new issues in Pantheon environments? |
It appears to cause problems in Pantheon environments. I'm working on a new patch as I think the problem is with the changes that we're originally made to use |
So, I've tried another patch and this just seems strange. Something more changed in 1.4.2 that breaks connectivity on Pantheon with this fix, whereas prior to all of these changes in 1.4.2(at least as far back as 1.3.4) this was not a problem. With the current patches I'm now getting connection refused errors with Redis.
|
So, this is interesting as I thought that Pantheon was using Redis server v6 along with the PHP 8.0 hosting, and Redis server v5 along with PHP 7.4. However, I'm connecting to the remote instances and everything is telling me that Pantheon is running some super old v2.8 Redis servers. 😱 |
@timnolte While we don't have anything public to announce right at this moment, someone from Pantheon will be reaching out to you in Slack regarding Redis versions. |
@jazzsequence so I believe I found the issue in the current version of the plugin. This line(https://github.com/pantheon-systems/wp-redis/blob/default/object-cache.php#L1278) is wrong as the function attributes are backwards. https://www.php.net/manual/en/function.array-replace-recursive.php
|
I have updated this patch with the correct fixes so that some of the changes in this PR actually work on Pantheon hosting. |
@jazzsequence just a note that I have opened up an issue regarding the |
* fix: Fixes assumption that CACHE_PORT & CACHE_PASSWORD are Set. * Fixes #359 * Falls back on port 6379 if the CACHE_PORT is not configured. * Doesn't require a CACHE_PASSWORD to be set when it isn't used, or can't be. * Improves code quality by reducing Redis default port & databasei duplicate values to a share variables. * Fixes invalid code changes made in PR [#400 ](#400) to the core plugin connectivity testing that prevent connectivty checks if the port/password/database aren't explicitly defined. * update changelog --------- Co-authored-by: Chris Reynolds <[email protected]>