Browse code

ndb_redis: add result check when reconnecting

Reported and provided solution by @kritarthh

follow-up #2461

Victor Seva authored on 02/03/2021 14:16:02
Showing 1 changed files
... ...
@@ -1059,6 +1059,11 @@ int redisc_exec(str *srv, str *res, str *cmd, ...)
1059 1059
 			if(redisc_reconnect_server(rsrv)==0)
1060 1060
 			{
1061 1061
 				rpl->rplRedis = redisvCommand(rsrv->ctxRedis, cmd->s, ap4);
1062
+				if(rpl->rplRedis == NULL)
1063
+				{
1064
+					redis_count_err_and_disable(rsrv);
1065
+					goto error_exec;
1066
+				}
1062 1067
 			} else {
1063 1068
 				LM_ERR("unable to reconnect to redis server: %.*s\n",
1064 1069
 						srv->len, srv->s);