From 1a1787b622a6e8c1eefcb2d5794191b369b5fb07 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Sun, 7 Oct 2018 16:45:56 +0200 Subject: [PATCH] time sometimes goes backwards (...), do not penalize our QPS trackers when this happens --- pdns/dnsdist.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pdns/dnsdist.hh b/pdns/dnsdist.hh index 8f2e7a537..2fe1f8db7 100644 --- a/pdns/dnsdist.hh +++ b/pdns/dnsdist.hh @@ -423,7 +423,8 @@ public: { auto delta = d_prev.udiffAndSet(); - d_tokens += 1.0 * rate * (delta/1000000.0); + if(delta > 0.0) // time, frequently, does go backwards.. + d_tokens += 1.0 * rate * (delta/1000000.0); if(d_tokens > burst) { d_tokens = burst; -- 2.40.0