Conversation
The output is identical to CLIENT LIST but provides a single line for the current client only.
oranagra
left a comment
There was a problem hiding this comment.
There was some discussion about adding a command like CLIENT INFO [id].
but considering ACL, maybe we don't wanna mix it with the current one.
maybe another one needs to be added for that purpose, or maybe CLIENT LIST, needs to be added with an ID <id> argument.
WDYT?
|
I think |
|
@redis/core-team please approve |
| if (cl) { | ||
| o = catClientInfoString(o, cl); | ||
| o = sdscatlen(o, "\n", 1); | ||
| } |
There was a problem hiding this comment.
Should we also throw the invalid client ID on the else here instead of silently failing?
There was a problem hiding this comment.
Considered that, but that would mean failing the entire operation and returning an error instead of a verbatim text. To me that would make sense if we only handle a single ID at a time, but I don't feel too strongly about that.
There was a problem hiding this comment.
I was on the fence about this, I would be inclined to throw an error, but am fine either way. I would like to have some indication that an ID was requested but nothing was found, like a NULL response, but we can't do that here since it's trying to stay compatible with CLIENT list. It also seems annoying to have the request fail because a client was disconnected for some reason.
There was a problem hiding this comment.
unlike HMGET etc, where the index of the request has to match the index of the response. this one is a verbatim string, and each line has the ID which the user can match to the ones he requested.
it's not ideal, but considering the alternatives i think that's the right thing to do (current code).
|
@yossigo i think you can apply Itamar's suggestion and merge this. |
Co-authored-by: Itamar Haber <[email protected]>
86e8a82
* Add CLIENT INFO subcommand. The output is identical to CLIENT LIST but provides a single line for the current client only. * Add CLIENT LIST ID [id...]. Co-authored-by: Itamar Haber <[email protected]>
The output is identical to CLIENT LIST but provides a single line for
the current client only.