From 60ef2e36f2264d1d0baf61116324f9bcb11eadfc Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 9 Jun 2016 14:18:16 +0100 Subject: [Fix] Another fix for redis timeouts --- src/libstat/backends/redis_backend.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 */ -- cgit v1.2.3