gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: implement exponential back-


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: implement exponential back-off cool down for ARM process restarts
Date: Tue, 05 Sep 2017 14:20:28 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new c1a9bb5df implement exponential back-off cool down for ARM process 
restarts
c1a9bb5df is described below

commit c1a9bb5df380beb363f56116bad6bd2e37df536a
Author: Christian Grothoff <address@hidden>
AuthorDate: Tue Sep 5 14:20:06 2017 +0200

    implement exponential back-off cool down for ARM process restarts
---
 src/arm/gnunet-service-arm.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c
index 19088c5cb..2db2ba0d1 100644
--- a/src/arm/gnunet-service-arm.c
+++ b/src/arm/gnunet-service-arm.c
@@ -1833,7 +1833,21 @@ maint_child_death (void *cls)
                    statcode,
                    GNUNET_STRINGS_relative_time_to_string (pos->backoff,
                                                            GNUNET_YES));
-        /* schedule restart */
+       {
+         /* Reduce backoff based on runtime of the process,
+            so that there is a cool-down if a process actually
+            runs for a while. */
+         struct GNUNET_TIME_Relative runtime;
+         unsigned int minutes;
+
+         runtime = GNUNET_TIME_absolute_get_duration (pos->restart_at);
+         minutes = runtime.rel_value_us / 
GNUNET_TIME_UNIT_MINUTES.rel_value_us;
+         if (minutes > 31)
+           pos->backoff = GNUNET_TIME_UNIT_ZERO;
+         else
+           pos->backoff.rel_value_us <<= minutes;
+       }
+       /* schedule restart */
         pos->restart_at = GNUNET_TIME_relative_to_absolute (pos->backoff);
         pos->backoff = GNUNET_TIME_STD_BACKOFF (pos->backoff);
         if (NULL != child_restart_task)

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]