aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-09 14:18:16 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-09 14:18:16 +0100
commit60ef2e36f2264d1d0baf61116324f9bcb11eadfc (patch)
treed01218671c938105cc3ced659240034c17d445d5
parent4502b6ce489f54c9cf7417a9770e38e012da7e1a (diff)
downloadrspamd-60ef2e36f2264d1d0baf61116324f9bcb11eadfc.tar.gz
rspamd-60ef2e36f2264d1d0baf61116324f9bcb11eadfc.zip
[Fix] Another fix for redis timeouts
-rw-r--r--src/libstat/backends/redis_backend.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c
index d7725a4c1..a2924d054 100644
--- a/src/libstat/backends/redis_backend.c
+++ b/src/libstat/backends/redis_backend.c
@@ -708,10 +708,14 @@ rspamd_redis_timeout (gint fd, short what, gpointer d)
msg_err_task_check ("connection to redis server %s timed out",
rspamd_upstream_name (rt->selected));
rspamd_upstream_fail (rt->selected);
+
+ if (rt->conn_state != RSPAMD_REDIS_CONNECTED) {
+ rspamd_session_remove_event (task->s, rspamd_redis_fin, rt);
+ }
+
rt->conn_state = RSPAMD_REDIS_TIMEDOUT;
redisAsyncFree (rt->redis);
rt->redis = NULL;
- REF_RELEASE (rt);
}
/* Called when we have connected to the redis server and got stats */