TT#39554 fix db_redis reconnect after error

Change-Id: I5afc87baf11ea32253348f5aea89db3b37d10bde
changes/00/23900/1
Richard Fuchs 7 years ago
parent 336340fab9
commit da9a2fabbb

@ -50,3 +50,4 @@ sipwise/avpops_avp_subst_pvar.patch
sipwise/tt37692.patch
sipwise/dtmf-blocking.patch
sipwise/media-blocking.patch
sipwise/fix_db_redis_reconnect.patch

@ -0,0 +1,36 @@
--- a/src/modules/db_redis/redis_connection.c
+++ b/src/modules/db_redis/redis_connection.c
@@ -390,7 +390,7 @@
void db_redis_consume_replies(km_redis_con_t *con) {
redisReply *reply = NULL;
redis_key_t *query;
- while (con->append_counter > 0 && !con->con->err) {
+ while (con->append_counter > 0 && con->con && !con->con->err) {
LM_DBG("consuming outstanding reply %u", con->append_counter);
db_redis_get_reply(con, (void**)&reply);
if (reply) {
@@ -410,4 +410,4 @@
} else {
return "<broken redis connection>";
}
-}
\ No newline at end of file
+}
--- a/src/modules/db_redis/redis_connection.h
+++ b/src/modules/db_redis/redis_connection.h
@@ -35,6 +35,8 @@
if (!(reply)) { \
LM_ERR("Failed to fetch type entry: %s\n", \
(con)->con->errstr); \
+ redisFree((con)->con); \
+ (con)->con = NULL; \
goto err; \
} \
if ((reply)->type == REDIS_REPLY_ERROR) { \
@@ -79,4 +81,4 @@
void db_redis_free_reply(redisReply **reply);
const char *db_redis_get_error(km_redis_con_t *con);
-#endif /* _REDIS_CONNECTION_H_ */
\ No newline at end of file
+#endif /* _REDIS_CONNECTION_H_ */
Loading…
Cancel
Save