[Mongrel] Recommendation: Stalled Mongrel? Memcache Hates Spaces

Michael Moen mi-mongrel at moensolutions.com
Thu Jan 4 12:45:32 EST 2007


On Jan 2, 2007, at 10:41 AM, Zed A. Shaw wrote:

> Since memcache-client doesn't currently escape your keys for you  
> (not sure if it should actually), you have to do this yourself or  
> bad super evil things happen.  The few people who have made this  
> change report no more stopped mongrel processes.
>
> Please try this out and report back to me if it fixes things.

Zed- I rolled out a patch on the JibJab cluster yesterday to address  
this and I haven't had to go after any dogs with a rubber hose since,  
and beating bad dogs has been a regular task for a while now.

I have no idea where spaces or control characters could get into the  
keys, but I'm not the only monkey banging on a keyboard here so who  
knows.

In case anybody wants a painless way to handle this, I added the  
following to my overrides:

class MemCache
   protected

   def make_cache_key(key)
     key.gsub!(/[^\w:]/, '_')
     @namespace.nil? ? key.to_s : "#{@namespace}:#{key}"
   end
end



More information about the Mongrel-users mailing list