logo       

Re: Recommendation: Stalled Mongrel? Memcache Hates Spaces: msg#00034

lang.ruby.mongrel.general

Subject: Re: Recommendation: Stalled Mongrel? Memcache Hates Spaces


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



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise