We have a rather weird hack in the /data/conf/global.inc file which disables Redis cache completely for all requests with $_SERVER['HTTP_USER_AGENT'] not set/empty, which is typical for all PHP-CLI based requests:
if (!isset($_SERVER['HTTP_USER_AGENT'])) {
$use_redis = FALSE;
$use_cache = FALSE;
}
The problem is that while it fixes critical issue with provisioning new Drupal 7 based sites in Aegir, it should be disabled *only and only* for new D7 sites provisioning, as otherwise it basically breaks all cache clear actions - including those performed on site cron (which is run with drush by default) and also those issued on command line directly with drush cc all.
This is a major cache logic fail and already a release blocker.
We have to find a way to disable Redis only on D7 site provisioning, since it is the only task which fails when Redis is active, while all other tasks work just fine.
Comments
Comment #1
jim kirkpatrick commentedPerhaps a control file in the sites/[sitename] directory along the lines of the .../cache/NO.txt control? e.g.
sites/[sitename]/PROVISION.txtI don't have any concept of how much caching logic this would alter but the principle is tried and tested.
Comment #2
omega8cc commentedTurning Redis completely OFF is easy, but it is rather useless possibility. It should be smart when ON and just work.
Comment #3
omega8cc commentedAnd no, no control file can help, as we need that switch built-in the Provision itself.
Comment #4
aanjaneyam commentedany breakthrough in this bug?
Comment #5
omega8cc commentedNot yet, we were too busy with all that pre|during|post-Sandy mess in NYC.
Comment #6
jim kirkpatrick commentedFirstly, I hope you and everyone your way is ok and things aren't too f***ked up by Sandy.
Just throwing a few ideas around, maybe these are helpful/inspiring, or maybe they're junk ;-)
I'll leave it there but sounds like patches/extensions to Provision (or related modules) are needed in one way or another. I'm a Drupal dev and would be happy to work on that side of things... Let me know if I can help out.
Comment #7
obrienmd commentedre #6, my opinions FWIW:
Seems like a bad idea, there may be many other local http requests from a Drupal instance.
I like this idea, but seems like it might be time-intensive depending on the Provision patching required.
I like this idea, don't know how feasible it is.
Agree on smell :)
Not sure if we have access to this when global.inc is included. Also, in general, I fear how general this is.
Could be a maintainability nightmare.
Comment #8
omega8cc commentedThanks for all suggestions!
Here is the magical fix :) http://drupalcode.org/project/barracuda.git/commit/f8489f2
Comment #9
obrienmd commentedIf a request is not via drush, the first function_exists will fail, right?
Comment #10
omega8cc commentedCorrect. So it disables Redis on the fly only when it is drush based
provision-installcommand running. Exactly what we need to avoid failed D7 sites provisioning, but also to allow Redis to be active in all other tasks or on command line directly.Comment #11
obrienmd commentedAwesome, thanks for the clarification!
Comment #12
tribe_of_dan commentedFantastic! Thanks @omega8cc it must have been a busy few days for you all.
Is there anything preventing 2.0.4 release now? Sorry about the status change, I don't know why it did that...
Comment #13
jim kirkpatrick commentedFixing the status.
Comment #14.0
(not verified) commentedTypo fixed.