]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Try to hunt issue with redis pool failures
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 6 Sep 2016 16:03:48 +0000 (17:03 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 6 Sep 2016 16:40:13 +0000 (17:40 +0100)
src/libserver/redis_pool.c

index f3f64d2f57795864ee207a41b456852f58f96e74..e84f2360ea8d8c74a98e88ad0a59cfeff3d5389c 100644 (file)
@@ -332,7 +332,7 @@ rspamd_redis_pool_release_connection (struct rspamd_redis_pool *pool,
 
        conn = g_hash_table_lookup (pool->elts_by_ctx, ctx);
        if (conn != NULL) {
-               REF_RELEASE (conn);
+               g_assert (conn->active);
 
                if (is_fatal || ctx->err == REDIS_ERR_IO || ctx->err == REDIS_ERR_EOF) {
                        /* We need to terminate connection forcefully */
@@ -347,6 +347,8 @@ rspamd_redis_pool_release_connection (struct rspamd_redis_pool *pool,
                        rspamd_redis_pool_schedule_timeout (conn);
                        msg_debug_rpool ("mark connection inactive");
                }
+
+               REF_RELEASE (conn);
        }
        else {
                g_assert_not_reached ();