Skip to content

reset cmdable.process when copying cluster client #774

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

Merged
merged 1 commit into from
May 24, 2018

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