diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-01-13 10:06:31 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-01-13 10:06:31 +0000 |
commit | 13d9071f962ec51088ea2eefbe312c6c7682bf23 (patch) | |
tree | 69c83de32e356e21f2dc223bada210e66d416119 /src/libserver/redis_pool.c | |
parent | a0efb4c16292698298e787d07a6fe7ed1baa7c21 (diff) | |
download | rspamd-13d9071f962ec51088ea2eefbe312c6c7682bf23.tar.gz rspamd-13d9071f962ec51088ea2eefbe312c6c7682bf23.zip |
[Minor] Sigh - another try to avoid races
Diffstat (limited to 'src/libserver/redis_pool.c')
-rw-r--r-- | src/libserver/redis_pool.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libserver/redis_pool.c b/src/libserver/redis_pool.c index 732d3b5bf..3cae96deb 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 */ |