PragmaTwice commented on code in PR #2943:
URL: https://github.com/apache/kvrocks/pull/2943#discussion_r2078808023
##########
src/commands/cmd_server.cc:
##########
@@ -497,15 +508,26 @@ class CommandClient : public Commander {
*output = redis::RESP_OK;
}
return Status::OK();
+ } else if (subcommand_ == "reply") {
+ if (reply_mode_arg_ == "on") {
+ conn->SetReplyMode(Connection::ReplyMode::ON);
+ } else if (reply_mode_arg_ == "off") {
+ conn->SetReplyMode(Connection::ReplyMode::OFF);
+ } else if (reply_mode_arg_ == "skip") {
+ conn->SetReplyMode(Connection::ReplyMode::SKIP_ONCE_PENDING);
+ }
+ *output = redis::RESP_OK;
+ return Status::OK();
Review Comment:
Currently we have 4 states in the `ReplyMode` enum, and the
`SKIP_ONCE_PENDING` seems to ignore the reply of `CLIENT REPLY` itself. But if
we just don't reply in `CLIENT REPLY OFF|SKIP`, maybe we can remove the 3rd
state. e.g.
```c++
conn->SetReplyMode(reply_mode_); // reply_mode_ can be ON, OFF or SKIP (3
states).
if (reply_mode_ != Connection::ReplyMode::SKIP) {
*output = redis::RESP_OK;
}
return Status::OK();
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]