mirror of
https://github.com/fluencelabs/redis
synced 2025-06-22 13:31:32 +00:00
CLIENT GETNAME and CLIENT SETNAME introduced.
Sometimes it is much simpler to debug complex Redis installations if it is possible to assign clients a name that is displayed in the CLIENT LIST output. This is the case, for example, for "leaked" connections. The ability to provide a name to the client makes it quite trivial to understand what is the part of the code implementing the client not releasing the resources appropriately. Behavior: CLIENT SETNAME: set a name for the client, or remove the current name if an empty name is set. CLIENT GETNAME: get the current name, or a nil. CLIENT LIST: now displays the client name if any. Thanks to Mark Gravell for pushing this idea forward.
This commit is contained in:
@ -382,6 +382,7 @@ typedef struct redisClient {
|
||||
int fd;
|
||||
redisDb *db;
|
||||
int dictid;
|
||||
robj *name; /* As set by CLIENT SETNAME */
|
||||
sds querybuf;
|
||||
size_t querybuf_peak; /* Recent (100ms or more) peak of querybuf size */
|
||||
int argc;
|
||||
|
Reference in New Issue
Block a user