http://php.net/manual/en/function.time.php
We were using REQUEST_TIME as a constant, which it is not (at least not when we execute code). I've replaced all naked REQUEST_TIME and time() instances with $_SERVER['REQUEST_TIME'].
The nice side effect, apart from removing a warning, is that it fixes getMulti implementation and boosts the cache hit rate from 5% to approaching 100%.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 925096-remove-debugging-memcache-session.inc_.patch.txt | 711 bytes | sillygwailo |
| #10 | reverse_request_time.patch | 3.83 KB | robertdouglass |
| #4 | request_time.patch | 5.37 KB | robertdouglass |
| #3 | request_time.patch | 3.75 KB | robertdouglass |
| #1 | request_time.patch | 10.06 KB | robertdouglass |
Comments
Comment #1
robertdouglass commentedFor those who want a patch.
Comment #2
robertdouglass commented#925096 by robertDouglass: Fixed Use of REQUEST_TIME improper, incomplete.
Committing to 6.x-1.x.
Comment #3
robertdouglass commented#925096 by robertDouglass: Fixed Use of REQUEST_TIME improper, incomplete.
committed to D7 as well.
Comment #4
robertdouglass commentedPatched and committed to DRUPAL-5 for completeness.
Comment #5
swentel commented@robertdouglass : shouldn't memcache for D6 than be labeled in the info file for a least PHP > 5.1.x (although that's stupid since it doesn't load the module file at all) because $_SERVER['REQUEST_TIME'] is not available before that PHP version. You never know that someone comes complaining :) Or maybe a warning on the project page is enough ?
Comment #6
robertdouglass commentedYes, good point. I'll add that to the documentation and .info files.
Comment #7
robertdouglass commentedThese patches aren't totally correct either. bootstrap.inc does this:
I don't fully understand why I was getting cases of REQUEST_TIME not being set. Will investigate further, and possibly remove some of the $_SERVER instances as it seems unnecessary.
Comment #8
catchCore only does this for D7, in D6 there's no constant - which version were you seeing this on?
Comment #9
robertdouglass commentedI was seeing it on D6. Now that I'm clear about the difference I'll audit both versions to make sure it's all proper.
Comment #10
robertdouglass commentedI've reversed the changes made to D7 - all instances are now just REQUEST_TIME using the bootstrap.inc constant.
Comment #11
robertdouglass commentedComment #13
sillygwailoThe latest patch committed to the D7 branch appears to have a debugging statement in
_drupal_session_write().Comment #14
sillygwailoComment #15
robertdouglass commentedThanks Richard. Committed to 7.x-1.x