commit 677173f: Merge pull request #3147 from resec/master
GitHub
noreply at github.com
Mon Nov 18 11:49:27 UTC 2019
Author: Vsevolod Stakhov
Date: 2019-11-18 11:45:52 +0000
URL: https://github.com/rspamd/rspamd/commit/677173f90b0df5d54d29734d0f46799a85787544 (HEAD -> master)
Merge pull request #3147 from resec/master
[Fix] Fixing multiple classifiers on redis
src/libstat/backends/redis_backend.c | 11 +++----
src/libstat/stat_process.c | 61 ++++++++++++++----------------------
2 files changed, 27 insertions(+), 45 deletions(-)
diff --combined src/libstat/backends/redis_backend.c
index f21431590,08edf1a4f..2a2636f5f
--- a/src/libstat/backends/redis_backend.c
+++ b/src/libstat/backends/redis_backend.c
@@@ -946,7 -946,7 +946,7 @@@ rspamd_redis_stat_keys (redisAsyncConte
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 +1106,7 @@@ rspamd_redis_timeout (EV_P_ ev_timer *w
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 +1207,7 @@@ rspamd_redis_processed (redisAsyncConte
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) {
@@@ -1325,20 -1325,17 +1325,17 @@@ rspamd_redis_connected (redisAsyncConte
}
}
else {
- if (!rt->err) {
- g_set_error (&rt->err, rspamd_redis_stat_quark (), c->err,
- "skip obtaining bayes tokens for %s: "
- "not enough learns %d; %d required",
- rt->stcf->symbol, (int)rt->learned,
- rt->stcf->clcf->min_learns);
- }
+ msg_warn_task ("skip obtaining bayes tokens for %s of classifier "
+ "%s: not enough learns %d; %d required",
+ rt->stcf->symbol, rt->stcf->clcf->name,
+ (int)rt->learned, rt->stcf->clcf->min_learns);
}
}
}
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 -1366,7 +1366,7 @@@ rspamd_redis_learned (redisAsyncContex
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) {
More information about the Commits
mailing list