]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Another fix for redis timeouts
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 9 Jun 2016 13:18:16 +0000 (14:18 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 9 Jun 2016 13:18:16 +0000 (14:18 +0100)
src/libstat/backends/redis_backend.c

index d7725a4c1808210b3df729ed07a73344d0c37593..a2924d05452daa6b3681c30d702b762c2ad52149 100644 (file)
@@ -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 */