From dd2a849dbb5349c3412395d0a8eb0334b8b4a07e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 16 Feb 2017 13:14:59 +0000 Subject: [PATCH] [Fix] Do not destroy session when not all finish scripts are done --- src/worker.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/worker.c b/src/worker.c index 12a6acf2c..5995911b9 100644 --- a/src/worker.c +++ b/src/worker.c @@ -101,6 +101,7 @@ rspamd_worker_call_finish_handlers (struct rspamd_worker *worker) task = rspamd_task_new (worker, cfg); task->resolver = ctx->resolver; task->ev_base = ctx->ev_base; + task->flags |= RSPAMD_TASK_FLAG_PROCESSING; task->s = rspamd_session_create (task->task_pool, rspamd_worker_finalize, NULL, @@ -111,6 +112,8 @@ rspamd_worker_call_finish_handlers (struct rspamd_worker *worker) lua_call_finish_script (cfg->lua_state, sc, task); } + task->flags &= ~RSPAMD_TASK_FLAG_PROCESSING; + if (rspamd_session_pending (task->s)) { return TRUE; } -- 2.39.5