From: Vsevolod Stakhov Date: Mon, 13 Jan 2020 10:06:31 +0000 (+0000) Subject: [Minor] Sigh - another try to avoid races X-Git-Tag: 2.3~120 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=13d9071f962ec51088ea2eefbe312c6c7682bf23;p=thirdparty%2Frspamd.git [Minor] Sigh - another try to avoid races --- diff --git a/src/libserver/redis_pool.c b/src/libserver/redis_pool.c index 732d3b5bf3..3cae96debc 100644 --- a/src/libserver/redis_pool.c +++ b/src/libserver/redis_pool.c @@ -205,15 +205,15 @@ rspamd_redis_conn_timeout (EV_P_ ev_timer *w, int revents) if (conn->state == RSPAMD_REDIS_POOL_CONN_INACTIVE) { msg_debug_rpool ("scheduled soft removal of connection %p, refcount: %d", conn->ctx, conn->ref.refcount); - redisAsyncCommand (conn->ctx, rspamd_redis_on_quit, conn, "QUIT"); - conn->state = RSPAMD_REDIS_POOL_CONN_FINALISING; - ev_timer_again (EV_A_ w); - /* Prevent reusing */ if (conn->entry) { g_queue_unlink (conn->elt->inactive, conn->entry); conn->entry = NULL; } + + conn->state = RSPAMD_REDIS_POOL_CONN_FINALISING; + ev_timer_again (EV_A_ w); + redisAsyncCommand (conn->ctx, rspamd_redis_on_quit, conn, "QUIT"); } else { /* Finalising by timeout */