Skip to content

Conversation

@nziebart
Copy link
Contributor

@nziebart nziebart commented May 24, 2018

Fixes #773

The problem is c.cmdable.setProcess(c.Process) in the factory method. The reference to c.Process is specific to that instance. When we copy via cp := *c, the new client retains that reference, and thus methods invoked on the new client will end up calling Process on the old client.

To fix this, I took the same approach used in the non-cluster client: https://github.com/go-redis/redis/blob/master/redis.go#L361

@vmihailenco vmihailenco merged commit 0f9028a into redis:master May 24, 2018
vmihailenco added a commit that referenced this pull request Mar 11, 2020
reset cmdable.process when copying cluster client
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

Successfully merging this pull request may close these issues.

WrapProccess on ClusterClient does not work if client has been copied

2 participants