Windows: only retry ALLBUSY for five minutes
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 8 May 2013 17:08:30 +0000 (13:08 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 8 May 2013 21:21:23 +0000 (14:21 -0700)
Add a volbusyCount field to cm_req_t.  Increment the count each time
CM_ERROR_ALLBUSY is processed by cm_Analyze for a given request.
Wait 15 seconds between retries and retry up to 20 times and then
fail.  This prevents requests from blocking for a volume that isn't
going to come back online for hours.

Change-Id: I25e68565700dddceebecedf552d1e04cbe39b22a
Reviewed-on: http://gerrit.openafs.org/9876
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsd/cm_conn.c
src/WINNT/afsd/cm_conn.h

index cfe0d36..686e7c7 100644 (file)
@@ -564,9 +564,12 @@ cm_Analyze(cm_conn_t *connp,
                     volServerspp = NULL;
                 }
 
-                if (timeLeft > 7) {
-                    thrd_Sleep(5000);
-                    statep = cm_VolumeStateByID(volp, fidp->volume);
+               /*
+                * retry all replicas for 5 minutes waiting 15 seconds
+                * between attempts.
+                */
+               if (timeLeft > 20 && reqp->volbusyCount++ < 20) {
+                   thrd_Sleep(15000);
                     retry = 1;
                 }
                 cm_UpdateVolumeStatus(volp, fidp->volume);
index b340495..f81371a 100644 (file)
@@ -67,6 +67,7 @@ typedef struct cm_req {
     int tokenError;
     int idleError;
     int vnovolError;
+    int volbusyCount;
     afs_uint32 flags;
     clientchar_t * tidPathp;
     clientchar_t * relPathp;