aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_redis.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-08 14:40:38 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-08 14:40:38 +0100
commit2996fbba0a369032f96c0d6689ae2b6b623065d4 (patch)
tree1ce898f14b3fc530a11ed7167f467e886203d6eb /src/lua/lua_redis.c
parentd968214c74bb120c742955b506283a6938869605 (diff)
downloadrspamd-2996fbba0a369032f96c0d6689ae2b6b623065d4.tar.gz
rspamd-2996fbba0a369032f96c0d6689ae2b6b623065d4.zip
[Fix] Treat all errors in redis_pool as fatal errors for a connection
Diffstat (limited to 'src/lua/lua_redis.c')
-rw-r--r--src/lua/lua_redis.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lua/lua_redis.c b/src/lua/lua_redis.c
index 203def2d0..402190351 100644
--- a/src/lua/lua_redis.c
+++ b/src/lua/lua_redis.c
@@ -661,6 +661,8 @@ lua_redis_make_request (lua_State *L)
if (ud->ctx) {
msg_err_task_check ("cannot connect to redis: %s",
ud->ctx->errstr);
+ rspamd_redis_pool_release_connection (task->cfg->redis_pool,
+ ud->ctx, TRUE);
ud->ctx = NULL;
}
else {
@@ -701,7 +703,7 @@ lua_redis_make_request (lua_State *L)
else {
msg_info_task_check ("call to redis failed: %s", ud->ctx->errstr);
rspamd_redis_pool_release_connection (task->cfg->redis_pool,
- ud->ctx, FALSE);
+ ud->ctx, TRUE);
ud->ctx = NULL;
REDIS_RELEASE (ctx);
ret = FALSE;