Hi,
Finally decided to get memcached up and running with Roundcube -- awesome work there.
I ran into a problem getting it to go at first though. Turned on all the logging in memcache and found this relevant bit:
<28 get d5f4fbf9a78ea7c63f2919f1ba544fa0
FOUND KEY d5f4fbf9a78ea7c63f2919f1ba544fa0 28 sending key d5f4fbf9a78ea7c63f2919f1ba544fa0 28 END
28: going from conn_parse_cmd to conn_mwrite 28: going from conn_mwrite to conn_new_cmd 28: going from conn_new_cmd to conn_waiting 28: going from conn_waiting to conn_read 28: going from conn_read to conn_parse_cmd <28 delete d5f4fbf9a78ea7c63f2919f1ba544fa0 1
28 CLIENT_ERROR bad command line format. Usage: delete <key> [noreply]
...which eventually led me to http://www.php.net/manual/en/memcache.delete.php where this problem is mentioned in comments. The PHP docs there specifically say not to include the timeout parameter when calling memcache->delete(), but unfortunately, due to a bug in the current php5-memcached package in Debian, not including the parameter causes php to automatically append a "1" to the end of the delete command, which breaks memcached.
In rcube_session.php, I mucked about with the first line of mc_destroy(), changing it to:
$ret = $this->memcache->delete($key, 0);
...which makes everything happy, despite being incorrect.
I searched the dev- and users- mailing list archives and didn't find any other references to this particular problem, so I'm just mentioning it here in case anybody else gets bitten by it.
Thanks,
Rob Sheldon wrote:
Hi,
Finally decided to get memcached up and running with Roundcube -- awesome work there.
I ran into a problem getting it to go at first though. Turned on all the logging in memcache and found this relevant bit:
[...]
In rcube_session.php, I mucked about with the first line of mc_destroy(), changing it to:
$ret = $this->memcache->delete($key, 0);
...which makes everything happy, despite being incorrect.
I don't have a problem adding this to your code and becoming "incorrect" unless anybody else reports problems with that change. PHP usually doesn't complain about additional arguments passed to a function call, only if there are too few arguments passed.
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/ BT/aba52c80
On Sat, Jan 7, 2012 at 2:11 PM, Thomas Bruederli roundcube@gmail.comwrote:
Rob Sheldon wrote:
Hi,
Finally decided to get memcached up and running with Roundcube -- awesome work there.
I ran into a problem getting it to go at first though. Turned on all the logging in memcache and found this relevant bit:
[...]
In rcube_session.php, I mucked about with the first line of mc_destroy(), changing it to:
$ret = $this->memcache->delete($key, 0);
...which makes everything happy, despite being incorrect.
I don't have a problem adding this to your code and becoming "incorrect" unless anybody else reports problems with that change. PHP usually doesn't complain about additional arguments passed to a function call, only if there are too few arguments passed.
+1 for the change: http://docs.php.net/manual/en/memcache.delete.php
This states that it's not recommend to use the timeout paramter, but using 0 is safe and shouldn't break anything anywhere else.
Till
List info: http://lists.roundcube.net/dev/ BT/aba52c80
On Jan 07 2012 08:50 am, till wrote:
On Sat, Jan 7, 2012 at 2:11
PM, Thomas Bruederli <roundcube@gmail.com [1]> wrote:
Rob Sheldon
wrote:
Hi,
Finally decided to get memcached up and
running with Roundcube --
awesome work there.
I ran into
a problem getting it to go at first though. Turned on all
the
logging in memcache and found this relevant bit:
[...]
In rcube_session.php, I mucked about with the first line of
mc_destroy(), changing it to:
$ret =
$this->memcache->delete($key, 0);
...which makes everything
happy, despite being incorrect.
I don't have a problem adding
this to your code and becoming "incorrect"
unless anybody else
reports problems with that change. PHP usually doesn't
complain about
additional arguments passed to a function call, only if
there are too
few arguments passed.
+1 for the change:
http://docs.php.net/manual/en/memcache.delete.php [2]
This states
that it's not recommend to use the timeout paramter, but using 0 is safe and shouldn't break anything anywhere else.
Till
...assuming that the PHP dev team doesn't change their mind later, which, y'know, never happens...
I also had to make a similar change in /program/include/rcube_cache.php:
private function delete_record($key, $index=true)
{
if ($this->type == 'memcache')
$this->db->delete($this->ckey($key), 0);
...otherwise, the first time you sign out, you can't sign back in again. Looks like Roundcube tries to delete a previous cache id during login.
Those are the only two changes I've needed to make and everything has worked great so far. I try not to alter Roundcube's code at all (makes future upgrades a little less easy) but memcache was just too tempting.
Thanks,
On Sat, Jan 7, 2012 at 6:54 PM, Rob Sheldon rob@associatedtechs.com wrote:
**
On Jan 07 2012 08:50 am, till wrote:
On Sat, Jan 7, 2012 at 2:11 PM, Thomas Bruederli roundcube@gmail.comwrote:
Rob Sheldon wrote:
Hi,
Finally decided to get memcached up and running with Roundcube -- awesome work there.
I ran into a problem getting it to go at first though. Turned on all the logging in memcache and found this relevant bit:
[...]
In rcube_session.php, I mucked about with the first line of mc_destroy(), changing it to:
$ret = $this->memcache->delete($key, 0);
...which makes everything happy, despite being incorrect.
I don't have a problem adding this to your code and becoming "incorrect" unless anybody else reports problems with that change. PHP usually doesn't complain about additional arguments passed to a function call, only if there are too few arguments passed.
+1 for the change: http://docs.php.net/manual/en/memcache.delete.php
This states that it's not recommend to use the timeout paramter, but using 0 is safe and shouldn't break anything anywhere else. Till
...assuming that the PHP dev team doesn't change their mind later, which, y'know, never happens...
Memcache is not a core extension but since a lot of contributors to it are familiar with (or neck-deep in) the PHP process, follows BC principles throughout. If you have any issues, I can put you in touch with people who work on it. I happen to know a few of them. Just let me know. ;)
I also had to make a similar change in /program/include/rcube_cache.php:
private function delete_record($key, $index=true) { if ($this->type == 'memcache') $this->db->delete($this->ckey($key), 0);
...otherwise, the first time you sign out, you can't sign back in again. Looks like Roundcube tries to delete a previous cache id during login.
Those are the only two changes I've needed to make and everything has worked great so far. I try not to alter Roundcube's code at all (makes future upgrades a little less easy) but memcache was just too tempting.
Thanks,
- R.
+1 for that change as well.
Till
List info: http://lists.roundcube.net/dev/ BT/aba52c80