]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
bozo: cap retry delay
authorMichael Meffie <mmeffie@sinenomine.net>
Tue, 20 Aug 2013 20:48:34 +0000 (16:48 -0400)
committerStephan Wiesand <stephan.wiesand@desy.de>
Tue, 24 Sep 2013 20:18:29 +0000 (13:18 -0700)
Cap the retry delay to a reasonable amount of time instead
of just doubling the delay until it reaches 16 hours.

Reviewed-on: http://gerrit.openafs.org/10148
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 21c8f4809ee7af9d2ec76cb37747183cee0c0d33)

Change-Id: If10880ba5411af0ea66bcb50c8cce13f4155f2ad
Reviewed-on: http://gerrit.openafs.org/10199
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/bozo/bnode.c

index 749fe9ed2e34d35199be0ec86ab1e0230704e949..82e7bcafb0eed9e54df8d01450fd532682c77ff3 100644 (file)
@@ -47,6 +47,7 @@
 
 #define BNODE_LWP_STACKSIZE    (16 * 1024)
 #define BNODE_ERROR_COUNT_MAX   16   /* maximum number of retries */
+#define BNODE_ERROR_DELAY_MAX   60   /* maximum retry delay (seconds) */
 
 int bnode_waiting = 0;
 static PROCESS bproc_pid;      /* pid of waker-upper */
@@ -694,9 +695,12 @@ bproc(void *unused)
                        } else {
                            tb->errorStopCount++;
                            if (!tb->errorStopDelay) {
-                               tb->errorStopDelay = 1;
+                               tb->errorStopDelay = 1;   /* wait a second, then retry */
                            } else {
-                               tb->errorStopDelay *= 2;
+                               tb->errorStopDelay *= 2;  /* ramp up the retry delays */
+                           }
+                           if (tb->errorStopDelay > BNODE_ERROR_DELAY_MAX) {
+                               tb->errorStopDelay = BNODE_ERROR_DELAY_MAX; /* cap the delay */
                            }
                        }
                        tb->flags |= BNODE_ERRORSTOP;