From: bert hubert Date: Sun, 7 Oct 2018 14:45:56 +0000 (+0200) Subject: time sometimes goes backwards (...), do not penalize our QPS trackers X-Git-Tag: rec-4.2.0-alpha1~42^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a1787b622a6e8c1eefcb2d5794191b369b5fb07;p=thirdparty%2Fpdns.git time sometimes goes backwards (...), do not penalize our QPS trackers when this happens --- diff --git a/pdns/dnsdist.hh b/pdns/dnsdist.hh index 8f2e7a5379..2fe1f8db7f 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;