-
Notifications
You must be signed in to change notification settings - Fork 183
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
Invalid memory address or nil pointer when write commands in function _backgroundWrite #702
Comments
Hi @gj3233, do you have a reproducible program on this? And what do you mean by |
HI @rueian, I do not have a reproducible program on this, |
Hi @gj3233, From the clues you gave me:
I think the panic was caused by an incorrect error checking that falsely recycled an intermediate struct here: Lines 703 to 705 in 9ff4c60
#706 should fix the issue. You can try it with v1.0.52-alpha.3 |
HI @rueian much thanks! I will test with the fix later and update to you. |
v1.0.52 was released last week. I am going to close the issue for now. Please feel free to reopen if you are still suffering from this. |
Hi @rueian, as mentioned in this thread, our application also recently encountered this issue. We're trying to understand the trigger scenario for this bug. In our case, read qps wasn't high neither the redis node/cluster were restarting. However, there was a connection storm to the Redis cluster (as the pods were crash looping) and we're assuming that should be the primary reason. Is there a way to confirm this? Just to ensure that this bug doesn't occur again in case of connection storm in the future. |
Hi @nikhillimaje, As you know, non-pinned commands built by the command builder can’t be shared across multiple Do() and DoMulti() because they will be recycled by rueidis for saving memory allocations. The bug was caused by a wrong check for recycling errored commands internally. Connection storms, depending on your use cases and setup, might be an expected behavior. But it indeed could cause network errors on the client side and further triggered the previous wrong check and made those commands be falsely recycled. I can only say that was the only wrong check we know so far and has been fixed in the newer version. |
Hello,

Yesterday when testing with redis cluster, my application had been panic at line ( (of rueidis v1.0.46) :
return c.cs.s
which in function Commands():func (c *Completed) Commands() []string { return c.cs.s }
which is call by
err = writeCmd(p.w, cmd.Commands())
The complete code is:
`func (p *pipe) _backgroundWrite() (err error) {
var (
ones = make([]Completed, 1)
multi []Completed
ch chan RedisResult
flushDelay = p.maxFlushDelay
flushStart = time.Time{}
)
}`
Redis topology:
cluster enabled
3 master 3 replica
Action: Node is starting.
Could you help on this? Thanks. It seems
cmd
passed towriteCmd()
has something wrong that lead to the crash. It confused becausecmd
is read fromrange multi
, so I think something wrong happened tomulti
.The text was updated successfully, but these errors were encountered: