celluloid / celluloid-redis

UNMAINTAINED: See celluloid/celluloid#779
MIT License
50 stars 9 forks source link

Calling Redis from multiple fibers causes fibers to suspend indefinitely #9

Open felixyz opened 11 years ago

felixyz commented 11 years ago

The bug is illustrated here: https://gist.github.com/Felixyz/5771982

And a repo containing the same code and branches with variations here: https://github.com/Felixyz/celluloid-redis-bug

felixyz commented 11 years ago

I've run the tests on OS X 10.8.2.

felixyz commented 11 years ago

I discussed this with @tarcieri on #celluloid and he pointed out that Redis can't handle interleaved requests on the same connection, so I guess this should just be closed.

Perhaps it might be interesting to add functionality to this gem to create an internal pool of connections? I guess it would have to be implicitly one pool per actor.

tarcieri commented 11 years ago

Another interesting approach would be a sort of "pipeline manager" that gives out Futures for requested commands, sends them to the server in a pipelined manner, and can match up these futures to Redis's responses. See:

http://redis.io/topics/pipelining