You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have recently ran into an issue where different Go routines create their own Pipeline and added commands to their respective pipeline. However, when executing, the results appears to be mixed. When moved to Pipelined model, everything appear to be correct. According to the reference, it's safe for concurrent use by multiple goroutines
Expected Behavior
Based on documentation, these 2 should behavior similiarly. Pipelined is merely an alternative to Pipeline with Exec called upon function exit.
Current Behavior
Pipelined appears to be thread safe, but pipeline is not.
Steps to Reproduce
Create multiple Clients, each connected to a unique Replica in a cluster.
Sent ReadOnly successfully.
Each client runs the following:
Scan keys
For batch of 10 keys, run the following:
Pipelined was able to retrieve the data. But Pipeline often returns errors from node indicate MOVED
gofunc(keysstring) {
results:=make([]*redis.StringStringMapCmd, len(keys))
pipe:=iter.replica.Pipeline()
fori, key:=rangekeys {
results[i] =pipe.HGetAll(key)
}
_, err:=pipe.Exec()
// processing of err and results...
}()
Context (Environment)
Some common use for pipeline is Set along with Expire, or optimization for multiple commands destined for the same node. Each Pipeline will only be created and executed by 1 goroutine, but there will be multiple goroutines operating on their respective pipeline.
The text was updated successfully, but these errors were encountered:
I found the cause of the issue. It's when a Client is created, even ReadOnly is issued once immediately after the creation, it does not cover additional connections the Client may make.
I have recently ran into an issue where different Go routines create their own Pipeline and added commands to their respective pipeline. However, when executing, the results appears to be mixed. When moved to Pipelined model, everything appear to be correct. According to the reference, it's safe for concurrent use by multiple goroutines
Expected Behavior
Based on documentation, these 2 should behavior similiarly. Pipelined is merely an alternative to Pipeline with Exec called upon function exit.
Current Behavior
Pipelined appears to be thread safe, but pipeline is not.
Steps to Reproduce
Pipelined behaviors properly:
Pipeline does not:
Context (Environment)
Some common use for pipeline is Set along with Expire, or optimization for multiple commands destined for the same node. Each Pipeline will only be created and executed by 1 goroutine, but there will be multiple goroutines operating on their respective pipeline.
The text was updated successfully, but these errors were encountered: