-
Notifications
You must be signed in to change notification settings - Fork 730
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
valkey-cli: ensure output ends with a newline if missing when printing reply #1782
base: unstable
Are you sure you want to change the base?
Conversation
reply Example: 127.0.0.1:6379> multi OK 127.0.0.1:6379(TX)> client info QUEUED127.0.0.1:6379(TX)> Signed-off-by: xbasel <[email protected]>
I would guess it's more likely related to this code path, Line 2341 in 221ff44
|
Signed-off-by: xbasel <[email protected]>
fdb0f9d
to
dc12b53
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## unstable #1782 +/- ##
============================================
- Coverage 71.18% 71.01% -0.17%
============================================
Files 123 123
Lines 65619 65642 +23
============================================
- Hits 46712 46618 -94
- Misses 18907 19024 +117
|
(argc == 2 && !strcasecmp(command, "latency") && !strcasecmp(argv[1], "doctor")) || | ||
/* Format PROXY INFO command for Cluster Proxy: | ||
* https://github.com/artix75/redis-cluster-proxy */ | ||
(argc >= 2 && !strcasecmp(command, "proxy") && !strcasecmp(argv[1], "info")))) { | ||
output_raw = 1; | ||
} | ||
|
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.
can we correct the output_raw
in here? something like this:
if (config.in_multi) output_raw = 0; /* multi must in xxx mode. */
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.
Are you suggesting this for readability, or to address a problem?
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.
I assume readability, as it has the same result. I will say I would prefer we add a comment somewhere to include why multi does this. My hot take was going to be let's just do:
if (!config.in_multi) output_raw = 1; /* In a multi block, commands will return status instead of verbatim. */
I don't feel all that strongly though.
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.
You meant:
if (config.in_multi) output_raw = 0; /* In a multi block, commands will return status instead of verbatim. */
?
I want to skip the big if.
See 61559bf
This function could be more readable; I can refactor it in a separate PR.
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.
I meant my suggestion inside the block of text, so it minimizes the number of lines changed. I'm OK with this though.
(argc == 2 && !strcasecmp(command, "latency") && !strcasecmp(argv[1], "doctor")) || | ||
/* Format PROXY INFO command for Cluster Proxy: | ||
* https://github.com/artix75/redis-cluster-proxy */ | ||
(argc >= 2 && !strcasecmp(command, "proxy") && !strcasecmp(argv[1], "info")))) { | ||
output_raw = 1; | ||
} | ||
|
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.
I meant my suggestion inside the block of text, so it minimizes the number of lines changed. I'm OK with this though.
Signed-off-by: Madelyn Olson <[email protected]>
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.
i am ok with this, but i still prefer the smaller diff way. The logic is pretty simple, we can argue that we correct it after the big if block since it is in multi.
Not a blocker to me.
Example:
Fixes: #1778