}
}
- if (errorCode == CM_ERROR_TIMEDOUT) {
+ if (errorCode == 0) {
+ if (connp)
+ _InterlockedAnd(&connp->flags, ~CM_CONN_FLAG_NEW);
+ }
+ else if (errorCode == CM_ERROR_TIMEDOUT) {
osi_Log0(afsd_logp, "cm_Analyze passed CM_ERROR_TIMEDOUT");
if ( timeLeft > 5 ) {
thrd_Sleep(3000);
thrd_Sleep(1000);
retry = 1;
}
+
+ if (connp)
+ _InterlockedAnd(&connp->flags, ~CM_CONN_FLAG_NEW);
}
/* if there is nosuchvolume, then we have a situation in which a
/* special codes: VBUSY and VRESTARTING */
else if (errorCode == VBUSY || errorCode == VRESTARTING) {
+ if (connp)
+ _InterlockedAnd(&connp->flags, ~CM_CONN_FLAG_NEW);
+
if (fidp) {
code = cm_FindVolumeByID(cellp, fidp->volume, userp, reqp,
CM_GETVOL_FLAG_NO_LRU_UPDATE,
else if (errorCode == VNOVOL || errorCode == VMOVED || errorCode == VOFFLINE ||
errorCode == VSALVAGE || errorCode == VIO)
{
+ if (connp)
+ _InterlockedAnd(&connp->flags, ~CM_CONN_FLAG_NEW);
+
/* In case of timeout */
reqp->volumeError = errorCode;
if ( timeLeft > 2 )
retry = 1;
} else if ( errorCode == VNOVNODE ) {
+ if (connp)
+ _InterlockedAnd(&connp->flags, ~CM_CONN_FLAG_NEW);
+
if ( fidp ) {
osi_Log4(afsd_logp, "cm_Analyze passed VNOVNODE cell %u vol %u vn %u uniq %u.",
fidp->cell, fidp->volume, fidp->vnode, fidp->unique);
* is currently busy on the server. Unconditionally
* retry the request so an alternate call channel can be used.
*/
+ if (connp)
+ _InterlockedAnd(&connp->flags, ~CM_CONN_FLAG_NEW);
+
if (serverp)
sprintf(addr, "%d.%d.%d.%d",
((serverp->addr.sin_addr.s_addr & 0xff)),
* The RPC was not serviced so it can be retried and any
* existing status information is still valid.
*/
+ if (connp)
+ _InterlockedAnd(&connp->flags, ~CM_CONN_FLAG_NEW);
+
if (fidp) {
if (serverp)
sprintf(addr, "%d.%d.%d.%d",
* client should fail over to another server. If this is a
* request against a single source, the client may retry once.
*/
+ if (connp)
+ _InterlockedAnd(&connp->flags, ~CM_CONN_FLAG_NEW);
+
if (serverp)
sprintf(addr, "%d.%d.%d.%d",
((serverp->addr.sin_addr.s_addr & 0xff)),
(reqp->flags & CM_REQ_NEW_CONN_FORCED ? "yes" : "no"));
if (serverp) {
- if ((reqp->flags & CM_REQ_NEW_CONN_FORCED)) {
+ if ((connp->flags & CM_CONN_FLAG_NEW) ||
+ (reqp->flags & CM_REQ_NEW_CONN_FORCED)) {
lock_ObtainMutex(&serverp->mx);
if (!(serverp->flags & CM_SERVERFLAG_DOWN)) {
_InterlockedOr(&serverp->flags, CM_SERVERFLAG_DOWN);
(reqp->flags & CM_REQ_NEW_CONN_FORCED ? "yes" : "no"));
if (serverp) {
- if (reqp->flags & CM_REQ_NEW_CONN_FORCED) {
+ if ((connp->flags & CM_CONN_FLAG_NEW) ||
+ (reqp->flags & CM_REQ_NEW_CONN_FORCED)) {
reqp->errorServp = serverp;
reqp->tokenError = errorCode;
} else {
osi_Log2(afsd_logp, "cm_Analyze: rxkad error code 0x%x (%s)",
errorCode, s);
+ if (connp)
+ _InterlockedAnd(&connp->flags, ~CM_CONN_FLAG_NEW);
+
if (serverp) {
reqp->errorServp = serverp;
reqp->tokenError = errorCode;
* to answer our query. Therefore, we will retry the request
* and force the use of another server.
*/
+ if (connp)
+ _InterlockedAnd(&connp->flags, ~CM_CONN_FLAG_NEW);
+
if (serverp) {
reqp->errorServp = serverp;
reqp->tokenError = errorCode;
if ( timeLeft > 2 )
retry = 1;
} else {
+ if (connp)
+ _InterlockedAnd(&connp->flags, ~CM_CONN_FLAG_NEW);
+
if (errorCode) {
char * s = "unknown error";
switch ( errorCode ) {
cm_PutConn(connp);
/*
+
* clear the volume updated flag if we succeed.
* this way the flag will not prevent a subsequent volume
* from being updated if necessary.
rxs_Release(secObjp); /* Decrement the initial refCount */
_InterlockedAnd(&tcp->flags, ~CM_CONN_FLAG_FORCE_NEW);
+ _InterlockedOr(&tcp->flags, CM_CONN_FLAG_NEW);
}
long cm_ConnByServer(cm_server_t *serverp, cm_user_t *userp, afs_uint32 replicated, cm_conn_t **connpp)