-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Avoid CLIENT SETNAME command when using HELLO #2570
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
Conversation
…ENT SETNAME command when using HELLO
|
Hi! I wonder if this will solve the problem I described here #2537? Thanks. |
|
I don't quite understand what problem this PR is meant to solve. |
|
I suggest adding a hook to address the related issue. If the user sets a custom initialization function, we can use it instead of the default connection initialization method. |
| } | ||
|
|
||
| if c.opt.ClientName != "" { | ||
| if !clientNameSet && c.opt.ClientName != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO you can send this either way, and no need for the if check:
127.0.0.1:6379> hello 3 setname foo
1# "server" => "redis"
2# "version" => "6.2.12"
3# "proto" => (integer) 3
4# "id" => (integer) 4
5# "mode" => "standalone"
6# "role" => "master"
7# "modules" => (empty array)
127.0.0.1:6379> hello 3 setname ""
1# "server" => "redis"
2# "version" => "6.2.12"
3# "proto" => (integer) 3
4# "id" => (integer) 4
5# "mode" => "standalone"
6# "role" => "master"
7# "modules" => (empty array)
127.0.0.1:6379>
WDYT @filipecosta90
|
Closing this stale PR. |
The following PR allows for more control of the protocol version ( avoiding errors when we know beforehand what will be the supported protocol version ) and the removal of the extra
CLIENT SETNAME <string>command when we use HELLO in a successful manner.If no ProtocolVersion is specified we default to 3. RESP3 has certain advantages since when the connection is in this mode, Redis is able to reply with more semantical replies.