From 313b2240aec0447bb61453cf81f706120d826c30 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 18 Jul 2018 17:41:06 +0200 Subject: [PATCH] In addReplyErrorLength() only panic when replying to slave. See #5135 for more context. --- src/networking.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/networking.c b/src/networking.c index c08d7199..af742217 100644 --- a/src/networking.c +++ b/src/networking.c @@ -360,11 +360,12 @@ void addReplyErrorLength(client *c, const char *s, size_t len) { serverLog(LL_WARNING,"== CRITICAL == This %s is sending an error " "to its %s: '%s' after processing the command " "'%s'", from, to, s, cmdname); - /* Here we want to panic because when an instance is sending an - * error to another instance in the context of replication, this can + /* Here we want to panic because when a master is sending an + * error to some slave in the context of replication, this can * only create some kind of offset or data desynchronization. Better * to catch it ASAP and crash instead of continuing. */ - serverPanic("Continuing is unsafe: replication protocol violation."); + if (c->flags & CLIENT_SLAVE) + serverPanic("Continuing is unsafe: replication protocol violation."); } }