On Mon, Nov 28, 2011 at 02:01:59PM -0800, Tom wrote:
>
> So we've been digging around a bit, trying different setups and so
> on...
> We reverted one of our servers to the old setup and kept one with the
> new versions...
>
> Interestingly, it didn't happen at all yesterday, BUT (maybe instead)
> we got a lot of exceptions from redis...
>
> undefined method `inject' for #<String:0x0000000733b5d8>
>   /srv/www/jasperdocs-production/shared/bundle/ruby/1.9.1/bundler/gems/
> ruote-redis-c7efcd8a0802/lib/ruote/redis/storage.rb:240:in `get_many'
>   ruote (2.2.0) lib/ruote/part/storage_participant.rb:317:in
> `fetch_all'
>   ruote (2.2.0) lib/ruote/part/storage_participant.rb:260:in `query'

Hello Tom,

so the String issue occurs here:

  
https://github.com/tricycle/ruote-redis/blob/c7efcd8a080233aa7ba68423a17db0b113098122/lib/ruote/redis/storage.rb#L240

What does logging say redis is returning as a String ?

I've had such an issue previously, here's how I solved it:

  
https://github.com/jmettraux/ruote-redis/commit/cdb5712aa05f8717962898f9a9a3cd283d5de971

Anything that is returned that isn't an array is replaced with an empty array. 
It works well [with the the tests]. IIRC it only occurred in the tests tear 
down (I should double check, maybe it's a connection stale/closed issue in 
fact).

Seems it happens with mget too.

Maybe, this line

  
https://github.com/jmettraux/ruote-redis/blob/master/lib/ruote/redis/storage.rb#L287

could be replaced with something like

---8<---
docs = ids.length > 0 && @redis.mget(*ids)
docs = docs.is_a?(Array) ? docs : []
--->8---


> We have no idea what's going on here - our assumption is, that we have
> one (or many) stale redis connections. The interesting bit is, that
> restarting passenger fixes the issue. So we think passenger starts
> getting stale. The thing we couldn't figure out yet, is if the problem
> is with redis-rb or ruote-redis...
>
> I know that's a very vague description and everything, I was just
> wondering if you've seen anything like that before...

Sorry, no experience with stale connection. I have to admit I don't use redis 
in production.

Maybe we could add some connection check/re-establishment code if necessary.

I will dig further this get/mget issue here and come back to you. Meanwhile if 
you have more feedback, it'd be welcome.

I wonder about the overlap between connection stale and keys/mget returning a 
string instead of an array.


Cheers,

--
John Mettraux - http://lambda.io/processi

-- 
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en

Reply via email to