Side Channel

  • home
  • resources
Home › Blogs › angch's blog

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password

Navigation

  • Books
  • Feed aggregator

Recent blog posts

  • Ubuntu mirrors up and improved!
  • Google-jstemplate: Iterate object with unknown properties
  • nginx https proxypass for php apps
  • sugarcrm & memcache: Doing it Wrong
  • subversion and https in Ubuntu Karmic
  • Drupal: Views block delta converted to md5 hash
  • Ubuntu Server install requires PAE
  • Installing Drupal from command line
  • Drupal: Handling form field weight through CCK
  • minify javascript using Google Closure Compiler
more

angch's location

angch twitter

  • angch: Heading to Brunei. Business class for a change.
  • angch: tc qdisc htb activated on the mirror, and mirror reactivated. Hope nothing melts now.
  • angch: Hmmm, tbf doesn't work as advertised. htb does. #qos #linux
  • angch: @yoonkit me thinks #lucid is a much better tag than #lynx
  • angch: Great, you broke the dc's net and they disconnected us. Running to tpm from shah alam
more

memcache woes in Ubuntu Intrepid.

angch's picture

angch — Wed, 25/03/2009 - 19:03

Seems like Ubuntu Intrepid uses a beta version of memcache module for PHP. This has caused a number of grief in my Drupal 5 + cacherouter + memcache development site: e.g. http://drupal.org/node/245341#comment-1397634

Specifically, this is a bug where memcache::delete($key) does not work unless you specify the optional timeout value. This is uncovered after lots of testing and cross checking using:

<?php
$memcache
= new Memcache;
$memcache->connect('localhost', 11211) or die ("Could not connect");

$version = $memcache->getVersion();
echo
"Server's version: ".$version."<br/>\n";

for (
$i = 0; $i < 10; $i++) {
    print
"<br>$i:";
   
$ret = $memcache->add('foo', 1, 0, 2);
    if (
$ret === false) {
        print
"can't add. ";
       
sleep(1);
    } else {
        print
"<b>works</b>";
    }
   
// In the bugged version, you'd need
    // $ret = $memcache->delete('foo', 0);
    // to work properly. So to exhibit the bug:
   
$ret = $memcache->delete('foo');
}
print
"done";
phpinfo();
?>
I discovered that many weird behaviours go away when the stable version of php5-memcache is forwardported from Ubuntu Hardy. Attached is the .deb from Hardy i386 backported (forwardported?) to Intrepid for convenience.

AttachmentSize
Ubuntu Intrepid i386's backported php5-memcache_2.2.0-1_i386.deb25.23 KB
  • drupal
  • intrepid
  • memcache
  • ubuntu
  • angch's blog
  • Add new comment


Creative Commons License

  • home
  • resources

Standard Disclaimer.