From 1af89c35663dd364c8d46523f0d71adc64f8bde4 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 14 Aug 2018 12:51:54 +0100 Subject: [Fix] Add fail-safety for destroying sessions --- src/libstat/backends/redis_backend.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/libstat/backends') diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c index 69c14e167..5510cff05 100644 --- a/src/libstat/backends/redis_backend.c +++ b/src/libstat/backends/redis_backend.c @@ -1572,6 +1572,9 @@ rspamd_redis_process_tokens (struct rspamd_task *task, gint ret; const gchar *learned_key = "learns"; + if (rspamd_session_is_destroying (task->s)) { + return FALSE; + } if (tokens == NULL || tokens->len == 0 || rt->redis == NULL) { return FALSE; @@ -1664,6 +1667,10 @@ rspamd_redis_learn_tokens (struct rspamd_task *task, GPtrArray *tokens, goffset off; const gchar *learned_key = "learns"; + if (rspamd_session_is_destroying (task->s)) { + return FALSE; + } + up = rspamd_upstream_get (rt->ctx->write_servers, RSPAMD_UPSTREAM_MASTER_SLAVE, NULL, -- cgit v1.2.3