diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-12-25 20:51:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-12-25 20:51:03 +0000 |
commit | fd20a7d04e49f9317de85b7f40f79d447d6e1715 (patch) | |
tree | 2518533ec91bb2bb93828888ce49b1b1fd3faa31 | |
parent | 094c0ee00e4d4a4b7b7f66138d39c9ff7f8535f2 (diff) | |
download | gnunet-fd20a7d04e49f9317de85b7f40f79d447d6e1715.tar.gz gnunet-fd20a7d04e49f9317de85b7f40f79d447d6e1715.zip |
-LRN: fix normal child death restart.
It does work in the sense that child process is restarted.
However, i didn't have an opportunity to test it for non-default
processes (default processes are restarted immediately; non-default
processes should be restarted on demand).
-rw-r--r-- | src/arm/gnunet-service-arm.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index 733eac6c6..e8e1113f0 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c | |||
@@ -903,19 +903,21 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
903 | { | 903 | { |
904 | /* process terminated normally, allow restart at any time */ | 904 | /* process terminated normally, allow restart at any time */ |
905 | pos->restart_at.abs_value = 0; | 905 | pos->restart_at.abs_value = 0; |
906 | continue; | ||
907 | } | 906 | } |
908 | if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 907 | else |
909 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 908 | { |
910 | _ | 909 | if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
911 | ("Service `%s' terminated with status %s/%d, will restart in %llu ms\n"), | 910 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
912 | pos->name, statstr, statcode, pos->backoff.rel_value); | 911 | _ |
913 | /* schedule restart */ | 912 | ("Service `%s' terminated with status %s/%d, will restart in %llu ms\n"), |
914 | pos->restart_at = GNUNET_TIME_relative_to_absolute (pos->backoff); | 913 | pos->name, statstr, statcode, pos->backoff.rel_value); |
915 | pos->backoff = | 914 | /* schedule restart */ |
916 | GNUNET_TIME_relative_min (EXPONENTIAL_BACKOFF_THRESHOLD, | 915 | pos->restart_at = GNUNET_TIME_relative_to_absolute (pos->backoff); |
917 | GNUNET_TIME_relative_multiply | 916 | pos->backoff = |
918 | (pos->backoff, 2)); | 917 | GNUNET_TIME_relative_min (EXPONENTIAL_BACKOFF_THRESHOLD, |
918 | GNUNET_TIME_relative_multiply | ||
919 | (pos->backoff, 2)); | ||
920 | } | ||
919 | if (GNUNET_SCHEDULER_NO_TASK != child_restart_task) | 921 | if (GNUNET_SCHEDULER_NO_TASK != child_restart_task) |
920 | GNUNET_SCHEDULER_cancel (child_restart_task); | 922 | GNUNET_SCHEDULER_cancel (child_restart_task); |
921 | child_restart_task = | 923 | child_restart_task = |