commit 8b7d853: [Minor] Add check for map cache skew
Vsevolod Stakhov
vsevolod at highsecure.ru
Thu Nov 5 15:07:06 UTC 2020
Author: Vsevolod Stakhov
Date: 2020-11-05 15:02:46 +0000
URL: https://github.com/rspamd/rspamd/commit/8b7d8532b3b373203f9643048e0c41defe99e2df (HEAD -> master)
[Minor] Add check for map cache skew
---
src/libserver/maps/map.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/libserver/maps/map.c b/src/libserver/maps/map.c
index 079ca1cc9..14792753a 100644
--- a/src/libserver/maps/map.c
+++ b/src/libserver/maps/map.c
@@ -263,6 +263,14 @@ rspamd_map_cache_cb (struct ev_loop *loop, ev_timer *w, int revents)
w->repeat = cache_cbd->map->poll_timeout;
}
+ if (w->repeat < 0) {
+ msg_info_map ("cached data for %s has skewed check time: %d last checked, %d poll timeout, %.2f diff",
+ map->name, (int)cache_cbd->data->last_checked,
+ (int)cache_cbd->map->poll_timeout,
+ (rspamd_get_calendar_ticks () - cache_cbd->data->last_checked));
+ w->repeat = 0.0;
+ }
+
cache_cbd->last_checked = cache_cbd->data->last_checked;
msg_debug_map ("cached data is up to date for %s", map->name);
ev_timer_again (loop, &cache_cbd->timeout);
More information about the Commits
mailing list