diff --git a/src/networking.c b/src/networking.c index 56273fc7e..7696e8c28 100644 --- a/src/networking.c +++ b/src/networking.c @@ -3808,7 +3808,7 @@ size_t getClientMemoryUsage(client *c, size_t *output_buffer_mem_usage) { * classes of clients. * * The function will return one of the following: - * CLIENT_TYPE_NORMAL -> Normal client + * CLIENT_TYPE_NORMAL -> Normal client, including MONITOR * CLIENT_TYPE_SLAVE -> Slave * CLIENT_TYPE_PUBSUB -> Client subscribed to Pub/Sub channels * CLIENT_TYPE_MASTER -> The client representing our replication master. diff --git a/src/replication.c b/src/replication.c index 97e01b64d..885f2b17c 100644 --- a/src/replication.c +++ b/src/replication.c @@ -610,6 +610,7 @@ void replicationFeedMonitors(client *c, list *monitors, int dictid, robj **argv, while((ln = listNext(&li))) { client *monitor = ln->value; addReply(monitor,cmdobj); + updateClientMemUsageAndBucket(monitor); } decrRefCount(cmdobj); } diff --git a/src/server.c b/src/server.c index 6815aac3b..838695b88 100644 --- a/src/server.c +++ b/src/server.c @@ -917,11 +917,9 @@ void removeClientFromMemUsageBucket(client *c, int allow_eviction) { * together clients consuming about the same amount of memory and can quickly * free them in case we reach maxmemory-clients (client eviction). * - * Note: This function filters clients of type monitor, master or replica regardless + * Note: This function filters clients of type no-evict, master or replica regardless * of whether the eviction is enabled or not, so the memory usage we get from these - * types of clients via the INFO command may be out of date. If someday we wanna - * improve that to make monitors' memory usage more accurate, we need to re-add this - * function call to `replicationFeedMonitors()`. + * types of clients via the INFO command may be out of date. * * returns 1 if client eviction for this client is allowed, 0 otherwise. */