diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-13 13:58:09 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-13 13:58:09 +0000 |
commit | 684996ee80c4b834f10c764a71a7f22dd2f23f83 (patch) | |
tree | 54ebf01447ac6fa4e693d00a952cda580884fd16 /src/libstat | |
parent | 54e835fc3540cc4dae025976fd15a0ad9cf10833 (diff) | |
download | rspamd-684996ee80c4b834f10c764a71a7f22dd2f23f83.tar.gz rspamd-684996ee80c4b834f10c764a71a7f22dd2f23f83.zip |
[Minor] Add failure reason in the upstreams code
Diffstat (limited to 'src/libstat')
-rw-r--r-- | src/libstat/backends/redis_backend.c | 10 | ||||
-rw-r--r-- | src/libstat/learn_cache/redis_cache.c | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c index 90afe66d3..f21431590 100644 --- a/src/libstat/backends/redis_backend.c +++ b/src/libstat/backends/redis_backend.c @@ -946,7 +946,7 @@ rspamd_redis_stat_keys (redisAsyncContext *c, gpointer r, gpointer priv) msg_err ("cannot get keys to gather stat: unknown error"); } - rspamd_upstream_fail (cbdata->selected, FALSE); + rspamd_upstream_fail (cbdata->selected, FALSE, c->errstr); rspamd_redis_async_cbdata_cleanup (cbdata); redis_elt->cbdata = NULL; } @@ -1106,7 +1106,7 @@ rspamd_redis_timeout (EV_P_ ev_timer *w, int revents) msg_err_task_check ("connection to redis server %s timed out", rspamd_upstream_name (rt->selected)); - rspamd_upstream_fail (rt->selected, FALSE); + rspamd_upstream_fail (rt->selected, FALSE, "timeout"); if (rt->redis) { redis = rt->redis; @@ -1207,7 +1207,7 @@ rspamd_redis_processed (redisAsyncContext *c, gpointer r, gpointer priv) rspamd_upstream_name (rt->selected), c->errstr); if (rt->redis) { - rspamd_upstream_fail (rt->selected, FALSE); + rspamd_upstream_fail (rt->selected, FALSE, c->errstr); } if (!rt->err) { @@ -1338,7 +1338,7 @@ rspamd_redis_connected (redisAsyncContext *c, gpointer r, gpointer priv) else if (rt->has_event) { msg_err_task ("error getting reply from redis server %s: %s", rspamd_upstream_name (rt->selected), c->errstr); - rspamd_upstream_fail (rt->selected, FALSE); + rspamd_upstream_fail (rt->selected, FALSE, c->errstr); if (!rt->err) { g_set_error (&rt->err, rspamd_redis_stat_quark (), c->err, @@ -1369,7 +1369,7 @@ rspamd_redis_learned (redisAsyncContext *c, gpointer r, gpointer priv) rspamd_upstream_name (rt->selected), c->errstr); if (rt->redis) { - rspamd_upstream_fail (rt->selected, FALSE); + rspamd_upstream_fail (rt->selected, FALSE, c->errstr); } if (!rt->err) { diff --git a/src/libstat/learn_cache/redis_cache.c b/src/libstat/learn_cache/redis_cache.c index 0df3783ab..301232d28 100644 --- a/src/libstat/learn_cache/redis_cache.c +++ b/src/libstat/learn_cache/redis_cache.c @@ -114,7 +114,7 @@ rspamd_redis_cache_timeout (EV_P_ ev_timer *w, int revents) msg_err_task ("connection to redis server %s timed out", rspamd_upstream_name (rt->selected)); - rspamd_upstream_fail (rt->selected, FALSE); + rspamd_upstream_fail (rt->selected, FALSE, "timeout"); if (rt->has_event) { rspamd_session_remove_event (task->s, rspamd_redis_cache_fin, rt); @@ -166,7 +166,7 @@ rspamd_stat_cache_redis_get (redisAsyncContext *c, gpointer r, gpointer priv) rspamd_upstream_ok (rt->selected); } else { - rspamd_upstream_fail (rt->selected, FALSE); + rspamd_upstream_fail (rt->selected, FALSE, c->errstr); } if (rt->has_event) { @@ -188,7 +188,7 @@ rspamd_stat_cache_redis_set (redisAsyncContext *c, gpointer r, gpointer priv) rspamd_upstream_ok (rt->selected); } else { - rspamd_upstream_fail (rt->selected, FALSE); + rspamd_upstream_fail (rt->selected, FALSE, c->errstr); } if (rt->has_event) { |