From ba5eb44d144c6503c5da21057c126997f6ab662f Mon Sep 17 00:00:00 2001 From: antirez Date: Sun, 22 Dec 2013 10:15:35 +0100 Subject: [PATCH] Slave disconnection is an event worth logging. --- src/networking.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/networking.c b/src/networking.c index 0661137d7..f2913cf0c 100644 --- a/src/networking.c +++ b/src/networking.c @@ -666,6 +666,16 @@ void freeClient(redisClient *c) { } } + /* Log link disconnection with slave */ + if (c->flags & REDIS_SLAVE) { + char ip[REDIS_IP_STR_LEN]; + + if (anetPeerToString(c->fd,ip,sizeof(ip),NULL) == -1) + strncpy(ip,"?",REDIS_IP_STR_LEN); + redisLog(REDIS_WARNING,"Connection with slave %s:%d lost.", + ip, c->slave_listening_port); + } + /* Free the query buffer */ sdsfree(c->querybuf); c->querybuf = NULL; -- GitLab