-
Notifications
You must be signed in to change notification settings - Fork 1k
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
multi
can return nil?
#490
Comments
It tends to happen for us when we spawn a whole lot (100s or 1000s) of small jobs from one large job worker. |
@webandtech We do a lot of that as well! |
There is in fact the possibility that About the problem with Sidekiq: Does it use |
Turns out I can avoid the return value so I'll do that. See the linked PR if curious. |
Refactor redis usage to avoid nil result from multi, see redis/redis-rb#490
FYI the sidekiq-unique-jobs gem uses WATCH, which I believe is where this was originating. I had some other issues with that gem so ended up removing it from my Gemfile, which eliminated this issue from recurring for me. |
Could anyone else experiencing this tell me what Redis service they are using? One Sidekiq user says he saw this when rejiggering ElasticCache and ELB. I wonder if it happens when EC transparently fails over due to load? |
I believe this issue is actually mperham/connection_pool#67 where an ill-timed |
Yikes. Read the discussion in the other issue and on Twitter. |
EXEC can return an array, null (aborted transaction), or an error reply. This is fine. The corrupted connection is vary bad. Still not sure about what the cause of this it is, but is legit to believe that the timeout leaves the reply of the timed out command into the socket. If this is the case, redis-rb should do one of the following.
|
I went ahead and implemented a possible solution in #502 by keeping counters. Please take a look and provide feedback there. |
Fixed in 3.2.1. |
I've worked under the assumption that
multi
always returns an Array of command results. There appears to be an edge case that several Sidekiq users have reported recently wheremulti
returns nil, causing Sidekiq to raise an error.The only suspicious code I can find is this line.
Specifically the Sidekiq users are reporting this backtrace:
from this code:
I had one of them send me a sample backtrace making a typical Redis call so I could verify there were no monkeypatches (e.g. NewRelic) which might cause invalid returns.
This is happening with 3.0.7, 3.1.0 and 3.2.0. What's the right thing to do here? If nil is expected, what does a nil result mean?
The text was updated successfully, but these errors were encountered: