Kitura-redis icon indicating copy to clipboard operation
Kitura-redis copied to clipboard

With Multi other threads give ... RedisDomain Code=2 \"Unexpected result received from Redis Status(\"QUEUED\")\"

Open icyield opened this issue 7 years ago • 1 comments

I'm using the multi command. if let multi = redisDB?.multi() multi.lrange(dataflow.redisQueue, start: 0, end: len) multi.ltrim(dataflow.redisQueue, start: len+1, end: -1) //get len amount and remove atomically. multi.exec({ (response) in

Under high load I get errors from other threads (doing an rpush)

Error Domain=RedisDomain Code=2 "Unexpected result received from Redis Status("QUEUED")"

It seems that the multi command is either not atomic or does not block access to the redis server to other commands while it is queuing commands.

Can I use the multi command while in a threaded environment?

icyield avatar Dec 20 '17 20:12 icyield

As a fix I have added a separate redis instance. The multi cmd is done on the second instance and seems to have sorted the problem for me.

But in general seems like the multi cmd must be used with a Redis instance in a single thread.

icyield avatar Dec 20 '17 21:12 icyield