From 663f32e93ec2d17ca59c64c8115cd51183ea3629 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 8 May 2013 13:08:30 -0400 Subject: [PATCH] Windows: only retry ALLBUSY for five minutes 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 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsd/cm_conn.c | 9 ++++++--- src/WINNT/afsd/cm_conn.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/WINNT/afsd/cm_conn.c b/src/WINNT/afsd/cm_conn.c index cfe0d36..686e7c7 100644 --- a/src/WINNT/afsd/cm_conn.c +++ b/src/WINNT/afsd/cm_conn.c @@ -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); diff --git a/src/WINNT/afsd/cm_conn.h b/src/WINNT/afsd/cm_conn.h index b340495..f81371a 100644 --- a/src/WINNT/afsd/cm_conn.h +++ b/src/WINNT/afsd/cm_conn.h @@ -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; -- 1.9.4