mediocregopher / radix.v2

Redis client for Go
http://godoc.org/github.com/mediocregopher/radix.v2
MIT License
433 stars 92 forks source link

Use cluster package Could not get cluster info: EOF #42

Closed whatisgolang closed 7 years ago

whatisgolang commented 7 years ago

Use radix.v2 cluster module,I found some err log: Could not get cluster info: EOF and Cluster doesn't make sense, host:port might be gone

so,could not run redis cmd I check redis cluster all is ok, but run some cmd then all ok.

maybe the connect timeout ,add check code at init pool like this:

initialPool, err := c.newPool(o.Addr, true) if err != nil { return nil, err } c.pools[o.Addr] = initialPool go func() { for { p.Cmd("PING") time.Sleep(1 * time.Second) } }()

go c.spin()
if err := c.Reset(); err != nil {
    return nil, err
}
return &c, nil

by that can slove the problem?

thanks.

mediocregopher commented 7 years ago

Hey there, I'm really sorry but I can't really understand what the problem you're having is exactly. Also I think some of the formatting on your post got messed up a bit. I see that you got an error getting the cluster info, did that happen during initialization or was it later on during runtime? Was it a recurring issue or did it just output once and then fix itself? Is the app running on a different server than members of the redis cluster?

whatisgolang commented 7 years ago

@mediocregopher
the problem happen at runtime when no any operations over a period of time,then request redis cluster by radix.v2 cluster module. it is a recurring issue when no any operations,but run some redis cmd then fix iteself,so I doubt that is connecting timeout like the issue#21

thanks.

mediocregopher commented 7 years ago

Could you give me a code sample that consistently fails for you? Also is the app running on a different server than members of the redis cluster?