fix: switch ratelimiter to MonotonicClock (#167)

There is a known bug that `quanta` clock
used by default sometimes jumps back:
<https://github.com/metrics-rs/quanta/issues/111>.
This results in `governor` rate limiter
incorrectly rejecting the messages
even when less than the configured burst size
has been sent.

Switched to standard monotonic clock
which does not have this problem.
I tested that this fixed the problem for me,
chatmail relay test `test_exceed_rate_limit`
stopped failing randomly.

Fixes <https://github.com/chatmail/filtermail/issues/166>
This commit is contained in:
l
2026-08-18 12:21:28 +02:00
committed by missytake
parent bd995918ba
commit d12e1d53f7
3 changed files with 23 additions and 65 deletions
+4 -1
View File
@@ -19,7 +19,10 @@ mailparse = "0.16.1"
memchr = "2.8.0"
log = "0.4.29"
env_logger = "0.11.10"
governor = "0.10.4"
governor = { version = "0.10.4", default-features = false, features = [
"std",
"dashmap",
] }
viadkim = { version = "0.2.0" }
hickory-resolver = { version = "0.26.1", features = ["dnssec-ring"] }
lru = "0.17.0"