[sr-dev] git:5.4:3945ea2b: ndb_redis: add result check when reconnecting

Victor Seva linuxmaniac at torreviejawireless.org
Tue Mar 2 15:31:13 CET 2021


Module: kamailio
Branch: 5.4
Commit: 3945ea2b7e59a6d6385344967a24b7bcdfd5f307
URL: https://github.com/kamailio/kamailio/commit/3945ea2b7e59a6d6385344967a24b7bcdfd5f307

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2021-03-02T15:28:52+01:00

ndb_redis: add result check when reconnecting

Reported and provided solution by @kritarthh

follow-up #2461

(cherry picked from commit f82a2563000361b6b1b12b4bb72b9a8ee4c62292)

---

Modified: src/modules/ndb_redis/redis_client.c

---

Diff:  https://github.com/kamailio/kamailio/commit/3945ea2b7e59a6d6385344967a24b7bcdfd5f307.diff
Patch: https://github.com/kamailio/kamailio/commit/3945ea2b7e59a6d6385344967a24b7bcdfd5f307.patch

---

diff --git a/src/modules/ndb_redis/redis_client.c b/src/modules/ndb_redis/redis_client.c
index 15a86f7b10..e34b110eda 100644
--- a/src/modules/ndb_redis/redis_client.c
+++ b/src/modules/ndb_redis/redis_client.c
@@ -1059,6 +1059,11 @@ int redisc_exec(str *srv, str *res, str *cmd, ...)
 			if(redisc_reconnect_server(rsrv)==0)
 			{
 				rpl->rplRedis = redisvCommand(rsrv->ctxRedis, cmd->s, ap4);
+				if(rpl->rplRedis == NULL)
+				{
+					redis_count_err_and_disable(rsrv);
+					goto error_exec;
+				}
 			} else {
 				LM_ERR("unable to reconnect to redis server: %.*s\n",
 						srv->len, srv->s);




More information about the sr-dev mailing list