/* in seconds */
long cm_daemonCheckDownInterval = 180;
-long cm_daemonCheckUpInterval = 600;
+long cm_daemonCheckUpInterval = 240;
long cm_daemonCheckVolInterval = 3600;
long cm_daemonCheckCBInterval = 60;
long cm_daemonCheckLockInterval = 60;
long cm_daemonTokenCheckInterval = 180;
+long cm_daemonCheckBusyVolInterval = 600;
osi_rwlock_t cm_daemonLock;
osi_assert(cm_bkgQueueCount-- > 0);
lock_ReleaseWrite(&cm_daemonLock);
+ osi_Log1(afsd_logp,"cm_BkgDaemon processing request 0x%p", rp);
+
#ifdef DEBUG_REFCOUNT
osi_Log2(afsd_logp,"cm_BkgDaemon (before) scp 0x%x ref %d",rp->scp, rp->scp->refCount);
#endif
lock_ObtainWrite(&cm_daemonLock);
switch ( code ) {
- case CM_ERROR_TIMEDOUT:
+ case 0: /* success */
+ osi_Log1(afsd_logp,"cm_BkgDaemon SUCCESS: request 0x%p", rp);
+ break;
+ case CM_ERROR_TIMEDOUT: /* or server restarting */
case CM_ERROR_RETRY:
case CM_ERROR_WOULDBLOCK:
case CM_ERROR_ALLBUSY:
osi_QAddT((osi_queue_t **) &cm_bkgListp, (osi_queue_t **)&cm_bkgListEndp, &rp->q);
break;
default:
- osi_Log2(afsd_logp,"cm_BkgDaemon failed request dropped 0x%p code 0x%x",
+ osi_Log2(afsd_logp,"cm_BkgDaemon FAILED: request dropped 0x%p code 0x%x",
rp, code);
}
}
if (code == ERROR_SUCCESS)
cm_daemonTokenCheckInterval = dummy;
+ dummyLen = sizeof(DWORD);
+ code = RegQueryValueEx(parmKey, "BusyVolumeCheckInterval", NULL, NULL,
+ (BYTE *) &dummy, &dummyLen);
+ if (code == ERROR_SUCCESS)
+ cm_daemonCheckBusyVolInterval = dummy;
+
RegCloseKey(parmKey);
}
time_t lastDownServerCheck;
time_t lastUpServerCheck;
time_t lastTokenCacheCheck;
+ time_t lastBusyVolCheck;
char thostName[200];
unsigned long code;
struct hostent *thp;
lastDownServerCheck = now - cm_daemonCheckDownInterval/2 + (rand() % cm_daemonCheckDownInterval);
lastUpServerCheck = now - cm_daemonCheckUpInterval/2 + (rand() % cm_daemonCheckUpInterval);
lastTokenCacheCheck = now - cm_daemonTokenCheckInterval/2 + (rand() % cm_daemonTokenCheckInterval);
+ lastBusyVolCheck = now - cm_daemonCheckBusyVolInterval/2 * (rand() % cm_daemonCheckBusyVolInterval);
while (daemon_ShutdownFlag == 0) {
/* check to see if the listener threads halted due to network
now = osi_Time();
}
+ if (now > lastBusyVolCheck + cm_daemonCheckBusyVolInterval) {
+ lastVolCheck = now;
+ cm_CheckOfflineVolumes();
+ now = osi_Time();
+ }
+
if (now > lastCBExpirationCheck + cm_daemonCheckCBInterval) {
lastCBExpirationCheck = now;
cm_CheckCBExpiration();