Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
icyield opened this issue Dec 20, 2017 · 1 comment

Comments

@icyield
Copy link

icyield commented Dec 20, 2017

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
Copy link
Author

icyield commented Dec 20, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant