Re: [exim-dev] Randomising retry times?

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Michael Haardt
Data:  
Para: exim-dev
Asunto: Re: [exim-dev] Randomising retry times?
> It would seem to require only a little tweak to retry.c lines 741-751.

Like this?

--- src/retry.c.orig    2005-09-02 13:31:29.000000000 +0200
+++ src/retry.c 2005-09-02 13:38:28.000000000 +0200
@@ -746,8 +746,9 @@
             int last_actual_gap = now - retry_record->last_try;
             int lastgap = (last_predicted_gap < last_actual_gap)?
               last_predicted_gap : last_actual_gap;
-            next_try = now + ((lastgap < rule->p1)? rule->p1 :
-               (lastgap * rule->p2)/1000);
+            int next_gap = (lastgap*rule->p2)/1000;
+            if (next_gap<rule->p1) next_gap=rule->p1;
+            next_try = now + rule->p1 + random_number(next_gap-rule->p1);
             }
           }


The patch changes the start interval to the lower limit of the next
interval. I am not sure if that's a good idea or not, but I guess it
introduces enough jitter already to work fine.

Opinions?

Michael